Mount the uwsgi file instead of copying
This commit is contained in:
parent
aed53dbf8f
commit
026d736bdc
|
@ -3,13 +3,14 @@ version: "2"
|
||||||
services:
|
services:
|
||||||
app:
|
app:
|
||||||
image: pathogen/neptune
|
image: pathogen/neptune
|
||||||
build: ./docker
|
build: ./docker/prod
|
||||||
volumes:
|
volumes:
|
||||||
- ${PORTAINER_GIT_DIR}:/code
|
- ${PORTAINER_GIT_DIR}:/code
|
||||||
|
- ${PORTAINER_GIT_DIR}/docker/prod/uwsgi.ini:/conf/uwsgi.ini
|
||||||
- ${NEPTUNE_LOCAL_SETTINGS}:/code/app/local_settings.py
|
- ${NEPTUNE_LOCAL_SETTINGS}:/code/app/local_settings.py
|
||||||
- ${NEPTUNE_DATABASE_FILE}:/code/db.sqlite3
|
- ${NEPTUNE_DATABASE_FILE}:/code/db.sqlite3
|
||||||
ports:
|
ports:
|
||||||
- "${NEPTUNE_PORT}:8000"
|
- "${NEPTUNE_PORT}:8000" # uwsgi socket
|
||||||
env_file:
|
env_file:
|
||||||
- ../stack.env
|
- ../stack.env
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,21 @@
|
||||||
|
# syntax=docker/dockerfile:1
|
||||||
|
FROM python:3
|
||||||
|
|
||||||
|
RUN useradd -d /code pathogen
|
||||||
|
RUN mkdir /code
|
||||||
|
RUN chown pathogen:pathogen /code
|
||||||
|
|
||||||
|
RUN mkdir /conf
|
||||||
|
RUN chown pathogen:pathogen /conf
|
||||||
|
|
||||||
|
RUN mkdir /venv
|
||||||
|
RUN chown pathogen:pathogen /venv
|
||||||
|
|
||||||
|
USER pathogen
|
||||||
|
ENV PYTHONDONTWRITEBYTECODE=1
|
||||||
|
ENV PYTHONUNBUFFERED=1
|
||||||
|
WORKDIR /code
|
||||||
|
COPY requirements.prod.txt /code/
|
||||||
|
RUN python -m venv /venv
|
||||||
|
RUN . /venv/bin/activate && pip install -r requirements.prod.txt
|
||||||
|
CMD . /venv/bin/activate && uwsgi --ini /conf/uwsgi.ini
|
|
@ -6,3 +6,4 @@ opensearch-py
|
||||||
stripe
|
stripe
|
||||||
django-rest-framework
|
django-rest-framework
|
||||||
numpy
|
numpy
|
||||||
|
uwsgi
|
|
@ -0,0 +1,13 @@
|
||||||
|
[uwsgi]
|
||||||
|
chdir=/code
|
||||||
|
module=app.wsgi:application
|
||||||
|
env=DJANGO_SETTINGS_MODULE=app.settings
|
||||||
|
master=1
|
||||||
|
pidfile=/tmp/project-master.pid
|
||||||
|
socket=0.0.0.0:8000
|
||||||
|
processes=5
|
||||||
|
harakiri=20
|
||||||
|
max-requests=5000
|
||||||
|
vacuum=1
|
||||||
|
home=/venv
|
||||||
|
|
Loading…
Reference in New Issue