mlmym/Dockerfile

20 lines
611 B
Docker
Raw Permalink Normal View History

2023-06-30 19:41:35 +00:00
FROM golang:1.20-bullseye as builder
RUN git config --global --add safe.directory /app
WORKDIR /app
COPY go.* ./
RUN go mod download
COPY . ./
2023-07-23 22:19:53 +00:00
RUN git describe --tag > VERSION
2023-06-30 19:41:35 +00:00
RUN go build -v -o mlmym
FROM debian:bullseye-slim
WORKDIR /app
RUN set -x && apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y \
ca-certificates curl && \
2023-06-30 19:41:35 +00:00
rm -rf /var/lib/apt/lists/*
COPY --from=builder /app/mlmym /app/mlmym
COPY --from=builder /app/templates /app/templates
COPY --from=builder /app/public /app/public
2023-07-23 22:19:53 +00:00
COPY --from=builder /app/VERSION /app/VERSION
2023-06-30 19:41:35 +00:00
CMD ["./mlmym", "--addr", "0.0.0.0:8080"]