Launchpad

This commit is contained in:
2025-12-13 14:37:29 +08:00
parent b9a97c67e2
commit 0e0ff24195
5 changed files with 426 additions and 0 deletions

32
pkg/gateway/Dockerfile Normal file
View File

@@ -0,0 +1,32 @@
# Stage 1: Build the Go binary
FROM golang:1.21-alpine AS builder
WORKDIR /app
# Copy go.mod and go.sum to download dependencies
COPY go.mod go.sum ./
RUN go mod download
# Copy the rest of the source code
COPY . .
# Build the gateway service
WORKDIR /app/pkg/gateway
RUN CGO_ENABLED=0 GOOS=linux go build -v -o /app/server .
# Stage 2: Create the final minimal image
FROM alpine:latest
WORKDIR /app
# Copy the binary from the builder stage
COPY --from=builder /app/server .
# Copy the settings file
COPY ./pkg/gateway/settings.toml .
# Expose the port the gateway listens on
EXPOSE 8080
# Command to run the service
CMD ["/app/server"]