-
-
Notifications
You must be signed in to change notification settings - Fork 61
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add pm2 in dockerfile & restart docker ps on error (#97)
- Loading branch information
1 parent
4ed92b2
commit f215ab5
Showing
2 changed files
with
13 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,20 @@ | ||
# syntax=docker/dockerfile:1.3 | ||
FROM node:18-alpine AS builder | ||
COPY --chown=1000:1000 . /fredy | ||
FROM node:18 | ||
|
||
WORKDIR /fredy | ||
USER 1000 | ||
|
||
COPY . /fredy | ||
|
||
RUN yarn install | ||
|
||
RUN yarn global add pm2 | ||
|
||
RUN yarn run prod | ||
|
||
FROM node:16-alpine | ||
COPY --from=builder --chown=1000:1000 /fredy /fredy | ||
RUN mkdir /db /conf && \ | ||
chown 1000:1000 /db /conf && \ | ||
chmod 777 -R /db/ && \ | ||
ln -s /db /fredy/db && ln -s /conf /fredy/conf | ||
|
||
EXPOSE 9998 | ||
USER 1000 | ||
VOLUME [ "/conf", "/db" ] | ||
WORKDIR /fredy | ||
CMD node index.js --no-daemon | ||
|
||
CMD pm2-runtime index.js |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters