jokes-bapak2/api/Dockerfile

27 lines
485 B
Docker
Raw Permalink Normal View History

2023-08-12 05:26:05 +00:00
FROM golang:1.21.0-bookworm AS builder
2022-12-03 02:01:40 +00:00
WORKDIR /app
COPY . .
RUN go build -o main .
2023-08-12 05:26:05 +00:00
FROM debian:bookworm-slim AS runtime
2022-12-03 02:01:40 +00:00
WORKDIR /app
2023-08-12 05:26:05 +00:00
RUN apt-get update && \
apt-get upgrade --no-install-recommends -y && \
apt-get install -y curl ca-certificates && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
2022-12-03 02:01:40 +00:00
COPY --from=builder /app/main .
ENV PORT=5000
ENV HOSTNAME=0.0.0.0
ENV ENVIRONMENT=production
EXPOSE ${PORT}
2022-09-03 10:53:46 +00:00
ENTRYPOINT [ "/app/main" ]