diff --git a/Dockerfile b/Dockerfile index 8333b05..a14a0f3 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,10 +1,24 @@ -FROM alpine:3.11.6 AS build -RUN apk add --no-cache go +# Build container +FROM golang:1.17-bullseye AS build + +# Set build workdir WORKDIR /app + +# Copy app sources 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 -COPY --from=build /app/app /app/app -CMD ["/app/app"] + +# Copy binary +COPY --from=build /app/app . + +# Run app +CMD ["./app"]