Skip to content

Commit

Permalink
Update Dockerfiles to use Alpine-based Python image
Browse files Browse the repository at this point in the history
  • Loading branch information
AndPuQing committed Jan 19, 2024
1 parent 17ed5c8 commit 4047ca3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions backend/backend.dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM python:3.10
FROM python:3.10-alpine

WORKDIR /app/

Expand All @@ -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

Expand Down
8 changes: 4 additions & 4 deletions backend/celeryworker.dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM python:3.10
FROM python:3.10-alpine

WORKDIR /app/

Expand All @@ -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
Expand All @@ -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"]

0 comments on commit 4047ca3

Please sign in to comment.