mirror of https://github.com/rocboss/paopao-ce
Merge pull request #71 from alimy/pr-docker-compose
optimize #68 add docker --build-arg supportpull/72/head
commit
09529f2daa
@ -1,9 +1,19 @@
|
|||||||
FROM library/nginx
|
# 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
|
USER root
|
||||||
|
|
||||||
# copy static files
|
# copy static files
|
||||||
COPY ./dist/ /usr/share/nginx/html/
|
COPY --from=frontend /web/dist/ /usr/share/nginx/html/
|
||||||
|
|
||||||
# HEALTHCHECK
|
# HEALTHCHECK
|
||||||
HEALTHCHECK --interval=5s --timeout=3s --retries=3 CMD service nginx status | grep running || exit 1
|
HEALTHCHECK --interval=5s --timeout=3s --retries=3 CMD service nginx status | grep running || exit 1
|
||||||
|
Loading…
Reference in new issue