mirror of https://github.com/rocboss/paopao-ce
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.
19 lines
467 B
19 lines
467 B
# build frontend
|
|
FROM node:18-alpine as frontend
|
|
ARG API_HOST
|
|
ARG USE_DIST=no
|
|
WORKDIR /web
|
|
COPY . .
|
|
RUN [ empty$API_HOST = empty ] || echo "VITE_HOST=$API_HOST" >.env
|
|
RUN [ $USE_DIST != no ] || (yarn && yarn build)
|
|
|
|
FROM library/nginx
|
|
ARG API_HOST
|
|
ARG USE_DIST=no
|
|
USER root
|
|
|
|
# copy static files
|
|
COPY --from=frontend /web/dist/ /usr/share/nginx/html/
|
|
|
|
# HEALTHCHECK
|
|
HEALTHCHECK --interval=5s --timeout=3s --retries=3 CMD service nginx status | grep running || exit 1 |