-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add an init process, refactor the entrypoint
- Loading branch information
1 parent
aff5666
commit 0e8a461
Showing
2 changed files
with
18 additions
and
5 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,6 +1,8 @@ | ||
FROM node:18-alpine as dev | ||
LABEL author="Paolo Pustorino <[email protected]>" | ||
|
||
RUN apk add --no-cache tini | ||
|
||
# Variables | ||
ENV INSTALL_DIR=/opt/raneto | ||
ENV PORT=80 | ||
|
@@ -23,9 +25,20 @@ EXPOSE $PORT | |
# Configure the entrypoint script | ||
COPY build/node/entrypoint.sh /entrypoint.sh | ||
RUN chmod +x /entrypoint.sh | ||
CMD ["npm run start"] | ||
ENTRYPOINT ["/entrypoint.sh"] | ||
CMD ["npm", "run", "start"] | ||
ENTRYPOINT ["tini", "--", "/entrypoint.sh"] | ||
|
||
FROM dev as prod | ||
|
||
WORKDIR /opt/raneto | ||
RUN cd custom && npm install | ||
# Production build, must be all moved in a shared script. | ||
RUN cd themes/spark-playbook && \ | ||
npm install && \ | ||
npm run build && \ | ||
cd /opt/raneto && \ | ||
npm install && \ | ||
npm run postinstall | ||
|
||
# This should be moved before instaoll, but for some reasons it breaks the build. | ||
# We just use it now for the entrypoint. | ||
ENV NODE_ENV=production |
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