backend.dockerfile 1.1 KB

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