-
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.
Browse files
Browse the repository at this point in the history
- Loading branch information
Showing
4 changed files
with
40 additions
and
26 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 |
---|---|---|
|
@@ -5,33 +5,23 @@ LABEL author="Paolo Pustorino <[email protected]>" | |
ENV INSTALL_DIR=/opt/raneto | ||
ENV PORT=80 | ||
|
||
# Copy content and configuration | ||
COPY ./custom/server.js $INSTALL_DIR/ | ||
COPY ./custom/package.json $INSTALL_DIR/ | ||
COPY ./custom/package-lock.json $INSTALL_DIR/ | ||
COPY ./custom/config.js $INSTALL_DIR/config.js | ||
COPY ./custom/themes $INSTALL_DIR/themes | ||
COPY ./content $INSTALL_DIR/content | ||
COPY ./assets $INSTALL_DIR/assets | ||
COPY ./custom/patches $INSTALL_DIR/patches | ||
|
||
# Install raneto and deps | ||
# Set current working directory | ||
WORKDIR $INSTALL_DIR | ||
RUN npm ci && npm run postinstall | ||
|
||
# Move to the theme folder | ||
# to build the public/dist folder. | ||
# Raneto will search for public assets | ||
# here first. | ||
WORKDIR $INSTALL_DIR/themes/spark-playbook | ||
RUN \ | ||
npm ci && \ | ||
npm run build | ||
|
||
WORKDIR $INSTALL_DIR | ||
# Copy content and configuration | ||
COPY ./custom/server.js ./ | ||
COPY ./custom/package.json ./ | ||
COPY ./custom/package-lock.json ./ | ||
COPY ./custom/config.js ./config.js | ||
COPY ./custom/themes ./themes | ||
COPY ./content ./content | ||
COPY ./assets ./assets | ||
COPY ./custom/patches ./patches | ||
|
||
# Expose port 80 | ||
EXPOSE $PORT | ||
|
||
# Let's go | ||
CMD ["npm", "start"] | ||
# Configure the entrypoint script | ||
COPY build/node/entrypoint.sh /entrypoint.sh | ||
RUN chmod +x /entrypoint.sh | ||
ENTRYPOINT ["/entrypoint.sh"] |
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,5 +1,4 @@ | ||
|
||
all: theme-install-dep theme-build up | ||
all: up | ||
|
||
up: | ||
docker compose pull | ||
|
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 |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#!/bin/ash | ||
|
||
set -eo pipefail | ||
BASE=${PWD} | ||
|
||
if [ "${1}" = 'npm' ]; then | ||
echo "Installing and building theme..." | ||
cd /opt/raneto/themes/spark-playbook | ||
npm install | ||
npm run build | ||
echo "Finished installing and building theme." | ||
|
||
echo "Installing raneto's npm libraries..." | ||
cd /opt/raneto | ||
npm install | ||
npm run postinstall | ||
echo "Finished installing raneto's npm libraries." | ||
|
||
echo "...done\n" | ||
fi | ||
|
||
cd ${BASE} | ||
echo "Running command: ${@}" | ||
exec "$@" |
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