celeryworker.dockerfile 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. FROM python:3.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. ENV C_FORCE_ROOT=1
  19. COPY ./app /app
  20. WORKDIR /app
  21. COPY /${CELERY_ZIP_STORAGE} /app/${CELERY_ZIP_STORAGE}
  22. COPY /${CELERY_ZIP_STORAGE} /app/${CELERY_ZIP_STORAGE}
  23. ENV PYTHONPATH=/app
  24. COPY ./app/worker-start.sh /worker-start.sh
  25. RUN chmod +x /worker-start.sh
  26. CMD ["bash", "/worker-start.sh"]