npm install & grunt build moved to entrypoint

This commit is contained in:
Krzysztof Szumny 2015-08-20 21:40:25 +02:00
parent 26036319ad
commit d41ac3b508
2 changed files with 7 additions and 5 deletions

View File

@ -25,13 +25,10 @@ RUN \
npm install -g npm && \
printf '\n# Node.js\nexport PATH="node_modules/.bin:$PATH"' >> /root/.bashrc
RUN groupadd -r django && useradd -r -g django django
ADD . /app
RUN npm install -g grunt grunt-cli
RUN cd /app && npm install
RUN cd /app && grunt build
RUN groupadd -r django && useradd -r -g django django
ADD . /app
RUN chown -R django /app
@ -42,5 +39,6 @@ RUN chmod +x /entrypoint.sh && chown django /entrypoint.sh
RUN chmod +x /gunicorn.sh && chown django /gunicorn.sh
WORKDIR /app
USER django
ENTRYPOINT ["/entrypoint.sh"]

View File

@ -15,4 +15,8 @@ export DATABASE_URL=postgres://$POSTGRES_ENV_POSTGRES_USER:$POSTGRES_ENV_POSTGRE
{% if cookiecutter.use_celery == 'y' %}
export CELERY_BROKER_URL=$DJANGO_CACHE_URL
{% endif %}
npm install
grunt build
exec "$@"