2022-09-03 10:53:46 +00:00
|
|
|
FROM golang:1.19.0-bullseye AS builder
|
2021-07-09 13:46:12 +00:00
|
|
|
|
|
|
|
WORKDIR /app
|
|
|
|
|
|
|
|
COPY . .
|
|
|
|
|
2022-09-03 10:53:46 +00:00
|
|
|
RUN go build -o main .
|
|
|
|
|
|
|
|
FROM debian:bullseye AS runtime
|
|
|
|
|
|
|
|
WORKDIR /app
|
|
|
|
|
2022-09-10 13:09:55 +00:00
|
|
|
RUN apt-get update && apt-get upgrade --no-install-recommends -y \
|
|
|
|
&& apt-get install -y --no-install-recommends curl \
|
|
|
|
&& apt-get clean && rm -rf /var/lib/apt/lists/*
|
2022-09-10 13:05:46 +00:00
|
|
|
|
2022-09-03 10:53:46 +00:00
|
|
|
COPY --from=builder /app/main .
|
|
|
|
|
|
|
|
ENV PORT=5000
|
|
|
|
ENV HOSTNAME=0.0.0.0
|
|
|
|
ENV ENVIRONMENT=production
|
2021-07-09 13:46:12 +00:00
|
|
|
|
2021-07-15 19:21:22 +00:00
|
|
|
EXPOSE ${PORT}
|
|
|
|
|
2022-09-03 10:53:46 +00:00
|
|
|
ENTRYPOINT [ "/app/main" ]
|