backend.dockerfile 1.0 KB

123456789101112131415161718192021222324252627282930
  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 bash -c "if [ $INSTALL_DEV == 'true' ] ; then poetry install --no-root ; else poetry install --no-root --no-dev ; fi"
  15. # For development, Jupyter remote kernel, Hydrogen
  16. # Using inside the container:
  17. # jupyter lab --ip=0.0.0.0 --allow-root --NotebookApp.custom_display_url=http://127.0.0.1:8888
  18. ARG INSTALL_JUPYTER=false
  19. RUN bash -c "if [ $INSTALL_JUPYTER == 'true' ] ; then pip install jupyterlab ; fi"
  20. COPY ./app /app
  21. COPY /${BACKEND_ZIP_STORAGE} /app/${BACKEND_ZIP_STORAGE}
  22. COPY /${BACKEND_VIDEO_STORAGE} /app/${BACKEND_VIDEO_STORAGE}
  23. ENV PYTHONPATH=/app