- ⭐ Image Size: ~10MB
- Created Dockerfile [Multi-stage, Scrath]
- Create docker-compose file for ease of use [cmd: docker-compose up -d]
23 lines
233 B
Docker
23 lines
233 B
Docker
FROM golang:1.23-alpine as builder
|
|
|
|
WORKDIR /app
|
|
|
|
COPY go.mod .
|
|
|
|
RUN go mod download
|
|
|
|
COPY . .
|
|
|
|
RUN go build -o APP
|
|
|
|
FROM scratch
|
|
|
|
COPY --from=builder /app/APP .
|
|
|
|
COPY --from=builder /app/static ./static
|
|
|
|
EXPOSE 8080
|
|
|
|
CMD ["./APP"]
|
|
|