2022-10-13 14:26:43 +00:00
|
|
|
# syntax=docker/dockerfile:1
|
|
|
|
FROM python:3
|
|
|
|
|
|
|
|
RUN useradd -d /code xf
|
2022-10-15 21:41:41 +00:00
|
|
|
RUN mkdir -p /code
|
|
|
|
RUN chown -R xf:xf /code
|
2022-10-13 14:26:43 +00:00
|
|
|
|
2022-10-15 21:49:33 +00:00
|
|
|
RUN mkdir -p /conf/static
|
2022-10-13 14:26:43 +00:00
|
|
|
RUN chown xf:xf /conf
|
|
|
|
|
|
|
|
RUN mkdir /venv
|
|
|
|
RUN chown xf:xf /venv
|
|
|
|
|
|
|
|
USER xf
|
|
|
|
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
|
|
|
|
CMD . /venv/bin/activate && uvicorn --reload --workers 2 --uds /var/run/socks/app.sock app.asgi:application
|
|
|
|
# CMD . /venv/bin/activate && gunicorn -b 0.0.0.0:8000 --reload app.asgi:application -k uvicorn.workers.UvicornWorker
|