2023-11-24 23:48:21 +01:00
|
|
|
FROM python:3.10
|
2019-02-09 19:42:36 +04:00
|
|
|
|
2024-03-12 08:56:49 -05:00
|
|
|
ENV PYTHONDONTWRITEBYTECODE=1
|
|
|
|
|
|
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
|
2024-02-25 18:48:02 +01:00
|
|
|
COPY ./pyproject.toml ./poetry.lock* /app/
|
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
|
|
|
|
|
|
|
|
ENV C_FORCE_ROOT=1
|
|
|
|
|
|
|
|
|
|
ENV PYTHONPATH=/app
|
|
|
|
|
|
2024-02-25 18:48:02 +01:00
|
|
|
COPY ./alembic.ini /app/
|
|
|
|
|
|
|
|
|
|
COPY ./worker-start.sh /worker-start.sh
|
|
|
|
|
|
|
|
|
|
COPY ./app /app/app
|
2019-02-09 19:42:36 +04:00
|
|
|
|
|
|
|
|
RUN chmod +x /worker-start.sh
|
|
|
|
|
|
|
|
|
|
CMD ["bash", "/worker-start.sh"]
|