You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

25 lines
308 B

3 years ago
# Build container
FROM golang:1.18-bullseye AS build
3 years ago
3 years ago
# Set build workdir
WORKDIR /app
3 years ago
3 years ago
# Copy app sources
3 years ago
COPY . .
# Build app
3 years ago
RUN go build -o bin .
# ---
# Production container
FROM debian:bullseye-slim
# Set app workdir
WORKDIR /app
# Copy binary
COPY --from=build /app/bin .
3 years ago
# Run app
3 years ago
CMD ["./bin"]