mirror of
https://github.com/cookiecutter/cookiecutter-django.git
synced 2024-11-27 12:04:03 +03:00
188ff966f8
* Re-organize compose/ into environment-specific file groups Closes #1316. * Commit missing files That was weird: git failed to commit one specific folder previously
40 lines
1.0 KiB
Docker
40 lines
1.0 KiB
Docker
FROM python:3.5
|
|
|
|
ENV PYTHONUNBUFFERED 1
|
|
|
|
RUN groupadd -r django \
|
|
&& useradd -r -g django django
|
|
|
|
# Requirements have to be pulled and installed here, otherwise caching won't work
|
|
COPY ./requirements /requirements
|
|
RUN pip install --no-cache-dir -r /requirements/production.txt \
|
|
&& rm -rf /requirements
|
|
|
|
COPY ./compose/production/django/gunicorn.sh /gunicorn.sh
|
|
RUN sed -i 's/\r//' /gunicorn.sh
|
|
RUN chmod +x /gunicorn.sh
|
|
RUN chown django /gunicorn.sh
|
|
|
|
COPY ./compose/production/django/entrypoint.sh /entrypoint.sh
|
|
RUN sed -i 's/\r//' /entrypoint.sh
|
|
RUN chmod +x /entrypoint.sh
|
|
RUN chown django /entrypoint.sh
|
|
|
|
COPY ./compose/production/django/celery/worker/start.sh /start-celeryworker.sh
|
|
RUN sed -i 's/\r//' /start-celeryworker.sh
|
|
RUN chmod +x /start-celeryworker.sh
|
|
|
|
COPY ./compose/production/django/celery/beat/start.sh /start-celerybeat.sh
|
|
RUN sed -i 's/\r//' /start-celerybeat.sh
|
|
RUN chmod +x /start-celerybeat.sh
|
|
|
|
COPY . /app
|
|
|
|
RUN chown -R django /app
|
|
|
|
USER django
|
|
|
|
WORKDIR /app
|
|
|
|
ENTRYPOINT ["/entrypoint.sh"]
|