- Multi-stage Dockerfile for Go backend (golang:1.25-alpine -> alpine:3) - Multi-stage Dockerfile for Next.js frontend (bun:1 -> node:22-alpine) - docker-compose.yml with backend + frontend services, health checks - Next.js standalone output + API rewrites to proxy /api/* to backend - .dockerignore files for both services - .env.example documenting required environment variables
16 lines
297 B
Docker
16 lines
297 B
Docker
# Build
|
|
FROM golang:1.25-alpine AS builder
|
|
WORKDIR /app
|
|
COPY go.mod ./
|
|
RUN go mod download
|
|
COPY . .
|
|
RUN CGO_ENABLED=0 GOOS=linux go build -o server ./cmd/server
|
|
|
|
# Run
|
|
FROM alpine:3
|
|
RUN apk --no-cache add ca-certificates
|
|
WORKDIR /app
|
|
COPY --from=builder /app/server .
|
|
EXPOSE 8080
|
|
CMD ["./server"]
|