Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump python from 3.9.6-slim to 3.13.0-slim in /docker #231

Merged
merged 3 commits into from
Nov 23, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
FROM python:3.9.6-slim as build
FROM python:3.13.0-slim AS build
WORKDIR /opt/memebot/

# Install requirements.
COPY requirements.txt requirements.txt
RUN \
apt-get update -y && \
# gcc is required to build package aiohttp (https://docs.aiohttp.org/en/stable/) required by discord.py
apt-get install --no-install-recommends -y gcc=4:10.2.1-1 && \
apt-get install --no-install-recommends -y gcc=4:12.2.0-3 && \
# Remove apt lists
rm -rf /var/lib/apt/lists/*

Expand All @@ -15,22 +15,22 @@ RUN python3 -m venv /opt/venv
ENV PATH="/opt/venv/bin:$PATH"
RUN python3 -m pip install --no-cache-dir -r requirements.txt

FROM build as build-test
FROM build AS build-test
COPY tests tests
RUN python3 -m pip install --no-cache-dir -r tests/requirements.txt

# Prepare run image.
FROM python:3.9.6-slim as run-base
FROM python:3.13.0-slim AS run-base
WORKDIR /opt/memebot/
ENV PATH="/opt/venv/bin:$PATH"
COPY memebot memebot
ENTRYPOINT ["python3", "memebot/main.py"]

# Run release build.
FROM run-base as release
FROM run-base AS release
COPY --from=build /opt/venv /opt/venv

# Run test build.
FROM run-base as test
FROM run-base AS test
COPY tests tests
COPY --from=build-test /opt/venv /opt/venv
Loading