Files
photodisk/Dockerfile
Artem Mamonov acf9b43671 Initial commit
2025-02-06 02:36:10 +01:00

30 lines
568 B
Docker

FROM golang:1.20 AS builder
# Set the working directory
WORKDIR /app
# Copy go.mod and go.sum files
COPY . .
# Download all dependencies
RUN go mod download
# Build the Go application
RUN make build-linux
# Use a minimal base image
FROM scratch
# Set the working directory
WORKDIR /app
# Copy the binary from the builder stage
COPY --from=builder /app/cmd/backend .
COPY --from=builder /app/static ./static
COPY --from=builder /app/config.yaml .
# Expose the application port
EXPOSE 8080
# Command to run the binary
CMD ["./backend", "-config", "config.yaml"]