15 lines
371 B
Docker
15 lines
371 B
Docker
FROM golang:1.26-alpine
|
|
WORKDIR /app
|
|
|
|
COPY src/go.mod src/go.sum ./
|
|
RUN go mod download
|
|
COPY src/ .
|
|
|
|
# Satisfy go:embed during debug builds
|
|
RUN mkdir -p frontend/dist && touch frontend/dist/.placeholder
|
|
|
|
# Output the binary directly to /server to match the ENTRYPOINT
|
|
RUN CGO_ENABLED=0 GOOS=linux go build -ldflags="-s -w" -o /server .
|
|
|
|
EXPOSE 8080
|
|
ENTRYPOINT ["/server"] |