Browse Source

Dockerfile

master
Andrey Kovalev 3 years ago
parent
commit
368e2e926b
  1. 26
      Dockerfile

26
Dockerfile

@ -1,10 +1,24 @@
FROM alpine:3.11.6 AS build # Build container
RUN apk add --no-cache go FROM golang:1.17-bullseye AS build
# Set build workdir
WORKDIR /app WORKDIR /app
# Copy app sources
COPY . . COPY . .
RUN CGO_ENABLED=1 GOOS=linux go build -o app -tags musl cw-deals-watcher
FROM alpine:3.11.6 # Build app
RUN go build -o app .
# ---
# Production container
FROM debian:bullseye-slim
# Set app workdir
WORKDIR /app WORKDIR /app
COPY --from=build /app/app /app/app
CMD ["/app/app"] # Copy binary
COPY --from=build /app/app .
# Run app
CMD ["./app"]

Loading…
Cancel
Save