You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
paopao-ce/Dockerfile

33 lines
833 B

# build frontend
FROM node:18-alpine as frontend
WORKDIR /web
COPY web/ ./
RUN echo 'VITE_HOST=""'>.env && yarn && yarn build
# build backend
FROM golang:1.18-alpine AS backend
RUN apk --no-cache --no-progress add --virtual \
build-deps \
build-base \
git
3 years ago
3 years ago
WORKDIR /paopao-ce
COPY . .
COPY --from=frontend /web/dist ./web/dist
ENV GOPROXY=https://goproxy.cn
RUN make build TAGS='embed'
3 years ago
FROM alpine:3.16
3 years ago
ENV TZ=Asia/Shanghai
RUN apk update && apk add --no-cache ca-certificates && update-ca-certificates
WORKDIR /app/paopao-ce
COPY --from=backend /paopao-ce/release/paopao-ce .
COPY assets ./assets
COPY configs ./configs
3 years ago
VOLUME ["/app/paopao-ce/assets", "/app/paopao-ce/configs"]
EXPOSE 8008
3 years ago
HEALTHCHECK --interval=5s --timeout=3s --retries=3 CMD ps -ef | grep paopao-ce || exit 1
ENTRYPOINT ["/app/paopao-ce/paopao-ce"]