2023-11-15 04:14:19 +08:00
|
|
|
FROM python:3.8
|
2019-02-09 19:42:36 +04:00
|
|
|
|
2020-04-19 00:27:48 +03:00
|
|
|
WORKDIR /app/
|
|
|
|
|
|
|
|
# Install Poetry
|
2023-11-15 04:14:19 +08:00
|
|
|
RUN curl -sSL https://install.python-poetry.org | POETRY_HOME=/opt/poetry python && \
|
2020-04-19 00:27:48 +03:00
|
|
|
cd /usr/local/bin && \
|
|
|
|
ln -s /opt/poetry/bin/poetry && \
|
|
|
|
poetry config virtualenvs.create false
|
|
|
|
|
|
|
|
# Copy poetry.lock* in case it doesn't exist in the repo
|
|
|
|
COPY ./app/pyproject.toml ./app/poetry.lock* /app/
|
:recycle: Refactor backend, settings, DB sessions, types, configs, plugins (#158)
* :recycle: Refactor backend, update DB session handling
* :sparkles: Add mypy config and plugins
* :heavy_plus_sign: Use Python-jose instead of PyJWT
as it has some extra functionalities and features
* :sparkles: Add/update scripts for test, lint, format
* :wrench: Update lint and format configs
* :art: Update import format, comments, and types
* :art: Add types to config
* :sparkles: Add types for all the code, and small fixes
* :art: Use global imports to simplify exploring with Jupyter
* :recycle: Import schemas and models, instead of each class
* :truck: Rename db_session to db for simplicity
* :pushpin: Update dependencies installation for testing
2020-04-20 19:03:13 +02:00
|
|
|
|
|
|
|
# Allow installing dev dependencies to run tests
|
|
|
|
ARG INSTALL_DEV=false
|
2023-11-15 04:14:19 +08:00
|
|
|
RUN bash -c "if [ $INSTALL_DEV == 'true' ] ; then poetry install --no-root ; else poetry install --no-root --only main ; fi"
|
2019-02-09 19:42:36 +04:00
|
|
|
|
|
|
|
# For development, Jupyter remote kernel, Hydrogen
|
|
|
|
# Using inside the container:
|
2019-04-24 22:45:20 +04:00
|
|
|
# jupyter lab --ip=0.0.0.0 --allow-root --NotebookApp.custom_display_url=http://127.0.0.1:8888
|
:recycle: Refactor backend, settings, DB sessions, types, configs, plugins (#158)
* :recycle: Refactor backend, update DB session handling
* :sparkles: Add mypy config and plugins
* :heavy_plus_sign: Use Python-jose instead of PyJWT
as it has some extra functionalities and features
* :sparkles: Add/update scripts for test, lint, format
* :wrench: Update lint and format configs
* :art: Update import format, comments, and types
* :art: Add types to config
* :sparkles: Add types for all the code, and small fixes
* :art: Use global imports to simplify exploring with Jupyter
* :recycle: Import schemas and models, instead of each class
* :truck: Rename db_session to db for simplicity
* :pushpin: Update dependencies installation for testing
2020-04-20 19:03:13 +02:00
|
|
|
ARG INSTALL_JUPYTER=false
|
|
|
|
RUN bash -c "if [ $INSTALL_JUPYTER == 'true' ] ; then pip install jupyterlab ; fi"
|
2019-02-09 19:42:36 +04:00
|
|
|
|
|
|
|
ENV C_FORCE_ROOT=1
|
|
|
|
|
|
|
|
COPY ./app /app
|
|
|
|
WORKDIR /app
|
|
|
|
|
|
|
|
ENV PYTHONPATH=/app
|
|
|
|
|
|
|
|
COPY ./app/worker-start.sh /worker-start.sh
|
|
|
|
|
|
|
|
RUN chmod +x /worker-start.sh
|
|
|
|
|
|
|
|
CMD ["bash", "/worker-start.sh"]
|