backend.dockerfile 896 B

12345678910111213141516171819202122232425
  1. FROM tiangolo/uvicorn-gunicorn:python3.10
  2. WORKDIR /app/
  3. # Install Poetry
  4. RUN curl -sSL https://install.python-poetry.org | POETRY_HOME=/opt/poetry python3 && \
  5. cd /usr/local/bin && \
  6. ln -s /opt/poetry/bin/poetry && \
  7. poetry config virtualenvs.create false
  8. # Copy poetry.lock* in case it doesn't exist in the repo
  9. COPY ./app/pyproject.toml ./app/poetry.lock* /app/
  10. # Allow installing dev dependencies to run tests
  11. ARG INSTALL_DEV=false
  12. RUN bash -c "if [ $INSTALL_DEV == 'true' ] ; then poetry install --no-root ; else poetry install --no-root --no-dev ; fi"
  13. # For development, Jupyter remote kernel, Hydrogen
  14. # Using inside the container:
  15. # jupyter lab --ip=0.0.0.0 --allow-root --NotebookApp.custom_display_url=http://127.0.0.1:8888
  16. ARG INSTALL_JUPYTER=false
  17. RUN bash -c "if [ $INSTALL_JUPYTER == 'true' ] ; then pip install jupyterlab ; fi"
  18. COPY ./app /app
  19. ENV PYTHONPATH=/app