1234567891011121314151617181920 |
- FROM tiangolo/uvicorn-gunicorn-fastapi:python3.10
- WORKDIR /app/
- RUN curl -sSL https://install.python-poetry.org | POETRY_HOME=/opt/poetry python && \
- cd /usr/local/bin && \
- ln -s /opt/poetry/bin/poetry && \
- poetry config virtualenvs.create false
- COPY ./pyproject.toml ./poetry.lock* /app/
- ARG INSTALL_DEV=false
- RUN bash -c "if [ $INSTALL_DEV == 'true' ] ; then poetry install --no-root ; else poetry install --no-root --only main ; fi"
- ENV PYTHONPATH=/app
- ENV PYTHONDONTWRITEBYTECODE=1
- ENV PYTHONUNBUFFERED=1
- # COPY ./.env /
- # USER appuser
- VOLUME [ "/app" ]
- EXPOSE 8080
- CMD ["gunicorn", "-k", "uvicorn.workers.UvicornWorker", "-c", "gunicorn_conf.py", "main:app", "--reload"]
|