-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
55 additions
and
18 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
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,15 +1,22 @@ | ||
# Use an official Python runtime as a parent image | ||
FROM node:13.8.0-buster-slim | ||
# why do I need python to install nodejs reqs? python 2 at that :/ | ||
RUN apt update; apt install python3 make build-essential -y | ||
RUN apt-get update && apt-get install -y \ | ||
python3 make build-essential gosu \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
ENV PATH $PATH:env/bin | ||
ENV PYTHON python3 | ||
COPY frontend /opt/frontend | ||
# we do not want node to run as id 1000 | ||
RUN groupmod -g 999 node && usermod -u 999 -g 999 node | ||
RUN useradd --create-home application | ||
USER application | ||
COPY --chown=application frontend /opt/frontend | ||
WORKDIR /opt/frontend | ||
ENV FRONTEND_ASSSET_ROOT_DIR /opt/frontend/static_build | ||
RUN yarn | ||
RUN yarn jsdoc | ||
RUN yarn build | ||
COPY docker-entrypoint-static.sh /opt/docker-entrypoint-static.sh | ||
USER root | ||
ENTRYPOINT ["/opt/docker-entrypoint-static.sh"] | ||
CMD ["yarn", "dev"] |
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
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,13 @@ | ||
#!/bin/bash | ||
set -e | ||
if [ -n "${USER_UID}" ]; then | ||
usermod -u $USER_UID application | ||
fi | ||
if [ -n "${USER_GID}" ]; then | ||
groupmod -g $USER_GID application | ||
fi | ||
|
||
if [ ! -d node_modules ]; then | ||
yarn | ||
gosu application yarn | ||
fi | ||
exec "$@" | ||
gosu application "$@" |
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
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