From 4047ca308cb244186858da9d00fee1ab082959bf Mon Sep 17 00:00:00 2001 From: PuQing Date: Fri, 19 Jan 2024 15:28:21 +0800 Subject: [PATCH] Update Dockerfiles to use Alpine-based Python image --- backend/backend.dockerfile | 6 +++--- backend/celeryworker.dockerfile | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/backend/backend.dockerfile b/backend/backend.dockerfile index 3c3ee89..5af1988 100644 --- a/backend/backend.dockerfile +++ b/backend/backend.dockerfile @@ -1,4 +1,4 @@ -FROM python:3.10 +FROM python:3.10-alpine WORKDIR /app/ @@ -10,8 +10,8 @@ COPY ./app/pyproject.toml ./app/poetry.lock* /app/ # Allow installing dev dependencies to run tests ARG INSTALL_DEV=false -RUN bash -c "poetry self add https://pypi.tuna.tsinghua.edu.cn/packages/a8/ea/1a6df188d97a2f762a92e6df8ce75e0d25e6caefaa3a079c2d4efae7d721/poetry_plugin_pypi_mirror-0.4.1-py3-none-any.whl#sha256=51d1fabd782e670bfeb66beaf821df462649d8f6147c7efb02d1c71fe3c17f7b" -RUN bash -c "if [ $INSTALL_DEV == 'true' ] ; then POETRY_PYPI_MIRROR_URL=https://pypi.tuna.tsinghua.edu.cn/simple poetry install --no-root ; else POETRY_PYPI_MIRROR_URL=https://pypi.tuna.tsinghua.edu.cn/simple poetry install --no-root --only main ; fi" +RUN poetry self add https://pypi.tuna.tsinghua.edu.cn/packages/a8/ea/1a6df188d97a2f762a92e6df8ce75e0d25e6caefaa3a079c2d4efae7d721/poetry_plugin_pypi_mirror-0.4.1-py3-none-any.whl#sha256=51d1fabd782e670bfeb66beaf821df462649d8f6147c7efb02d1c71fe3c17f7b +RUN sh -c "if [ $INSTALL_DEV == 'true' ] ; then POETRY_PYPI_MIRROR_URL=https://pypi.tuna.tsinghua.edu.cn/simple poetry install --no-root ; else POETRY_PYPI_MIRROR_URL=https://pypi.tuna.tsinghua.edu.cn/simple poetry install --no-root --only main ; fi" COPY ./app /app diff --git a/backend/celeryworker.dockerfile b/backend/celeryworker.dockerfile index 1cfabc1..f47dbe4 100644 --- a/backend/celeryworker.dockerfile +++ b/backend/celeryworker.dockerfile @@ -1,4 +1,4 @@ -FROM python:3.10 +FROM python:3.10-alpine WORKDIR /app/ @@ -10,8 +10,8 @@ COPY ./app/pyproject.toml ./app/poetry.lock* /app/ # Allow installing dev dependencies to run tests ARG INSTALL_DEV=false -RUN bash -c "poetry self add https://pypi.tuna.tsinghua.edu.cn/packages/a8/ea/1a6df188d97a2f762a92e6df8ce75e0d25e6caefaa3a079c2d4efae7d721/poetry_plugin_pypi_mirror-0.4.1-py3-none-any.whl#sha256=51d1fabd782e670bfeb66beaf821df462649d8f6147c7efb02d1c71fe3c17f7b" -RUN bash -c "if [ $INSTALL_DEV == 'true' ] ; then POETRY_PYPI_MIRROR_URL=https://pypi.tuna.tsinghua.edu.cn/simple poetry install --no-root ; else POETRY_PYPI_MIRROR_URL=https://pypi.tuna.tsinghua.edu.cn/simple poetry install --no-root --only main ; fi" +RUN poetry self add https://pypi.tuna.tsinghua.edu.cn/packages/a8/ea/1a6df188d97a2f762a92e6df8ce75e0d25e6caefaa3a079c2d4efae7d721/poetry_plugin_pypi_mirror-0.4.1-py3-none-any.whl#sha256=51d1fabd782e670bfeb66beaf821df462649d8f6147c7efb02d1c71fe3c17f7b +RUN sh -c "if [ $INSTALL_DEV == 'true' ] ; then POETRY_PYPI_MIRROR_URL=https://pypi.tuna.tsinghua.edu.cn/simple poetry install --no-root ; else POETRY_PYPI_MIRROR_URL=https://pypi.tuna.tsinghua.edu.cn/simple poetry install --no-root --only main ; fi" ENV C_FORCE_ROOT=1 COPY ./app /app @@ -23,4 +23,4 @@ COPY ./app/worker-start.sh /worker-start.sh RUN chmod +x /worker-start.sh -CMD ["bash", "/worker-start.sh"] +CMD ["sh", "/worker-start.sh"]