mirror of
https://github.com/bolucat/Archive.git
synced 2025-09-26 20:21:35 +08:00
32 lines
527 B
Docker
32 lines
527 B
Docker
ARG APP_DIR=/app
|
|
|
|
### Builder ###
|
|
FROM golang:1.24-alpine AS builder
|
|
|
|
ARG APP_DIR
|
|
|
|
RUN apk add --no-cache make git
|
|
|
|
WORKDIR ${APP_DIR}
|
|
|
|
COPY go.mod go.sum ./
|
|
RUN go mod download
|
|
|
|
COPY . .
|
|
|
|
ENV CGO_ENABLED=0
|
|
RUN make juicity-server
|
|
|
|
### Prod ###
|
|
FROM alpine:latest AS dist
|
|
|
|
ARG APP_DIR
|
|
|
|
RUN set -ex \
|
|
&& apk upgrade \
|
|
&& apk add tzdata ca-certificates \
|
|
&& rm -rf /var/cache/apk/*
|
|
|
|
COPY --from=builder ${APP_DIR}/juicity-server /usr/bin/juicity-server
|
|
CMD ["juicity-server", "run", "-c", "/etc/juicity/server.json"]
|