use pm2 to guard and monitor the web service in docker file (#2238)

This commit is contained in:
Bowen Liang 2024-01-29 18:21:15 +08:00 • committed by GitHub
commit 965ca36525
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 16 additions and 12 deletions

View file

@ -40,12 +40,17 @@ ENV TZ UTC
RUN ln -s /usr/share/zoneinfo/${TZ} /etc/localtime \
&& echo ${TZ} > /etc/timezone
# global runtime packages
RUN yarn global add pm2 \
&& yarn cache clean
WORKDIR /app/web
COPY --from=builder /app/web/public ./public
COPY --from=builder /app/web/.next/standalone ./
COPY --from=builder /app/web/.next/static ./.next/static
COPY docker/pm2.json ./pm2.json
COPY docker/entrypoint.sh ./entrypoint.sh
ARG COMMIT_SHA