Skip to content
Snippets Groups Projects
Unverified Commit 129ec1f1 authored by Fredrik Jonsson's avatar Fredrik Jonsson Committed by GitHub
Browse files

Merge pull request #2860 from HyphaApp/fix/docker-build

Move npm install command to entrypoint script.
parents dedf317a 0790f45d
No related branches found
No related tags found
No related merge requests found
FROM cimg/python:3.9.10-node FROM cimg/python:3.9.10-node
# Set work directory # Set work directory.
WORKDIR /usr/local/hypha WORKDIR /usr/local/hypha
# Set environment variables # Set environment variables.
ENV API_BASE_URL http://apply.hypha.test:8090/api ENV API_BASE_URL http://apply.hypha.test:8090/api
ENV DATABASE_URL postgres://hypha:hypha@db:5432/hypha ENV DATABASE_URL postgres://hypha:hypha@db:5432/hypha
ENV DJANGO_SETTINGS_MODULE hypha.settings.dev ENV DJANGO_SETTINGS_MODULE hypha.settings.dev
ENV PYTHONDONTWRITEBYTECODE 1 ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1 ENV PYTHONUNBUFFERED 1
# Prepare for npm
COPY package.json package-lock.json /usr/local/hypha/
# Set owner on /usr/local. # Set owner on /usr/local.
RUN sudo chown -R circleci:circleci /usr/local RUN sudo chown -R circleci:circleci /usr/local
USER circleci
# Install node dependencies.
RUN npm install --global --quiet
# Install python dependencies. # Install python dependencies.
COPY requirements.txt requirements-dev.txt /usr/local/hypha/ COPY requirements.txt requirements-dev.txt /usr/local/hypha/
RUN pip3 install --quiet -r requirements-dev.txt RUN pip3 install --quiet -r requirements-dev.txt
# Run entrypoint.sh # Run entrypoint.sh.
ENTRYPOINT ["/usr/local/hypha/docker/entrypoint.dev.sh"] ENTRYPOINT ["/usr/local/hypha/docker/entrypoint.dev.sh"]
#!/bin/sh #!/bin/sh
#npm install --quiet # Install node packages and run build command.
npm install --quiet
npm run build npm run build
#pip3 install --quiet -r requirements-dev.txt # Run needed python commands.
python3 manage.py createcachetable python3 manage.py createcachetable
python3 manage.py collectstatic --noinput --verbosity=0 python3 manage.py collectstatic --noinput --verbosity=0
python3 manage.py migrate python3 manage.py migrate
python3 manage.py wagtailsiteupdate hypha.test apply.hypha.test 8090 python3 manage.py wagtailsiteupdate hypha.test apply.hypha.test 8090
# Start gunicorn server.
gunicorn hypha.wsgi:application --env DJANGO_SETTINGS_MODULE=hypha.settings.dev --reload --bind 0.0.0.0:9001 gunicorn hypha.wsgi:application --env DJANGO_SETTINGS_MODULE=hypha.settings.dev --reload --bind 0.0.0.0:9001
exec "$@" exec "$@"
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment