Skip to content

Commit

Permalink
fix(Dockerfile): update Python version in base image
Browse files Browse the repository at this point in the history
  • Loading branch information
Nat1anWasTaken committed May 13, 2024
1 parent 9dec9a5 commit 9ed3811
Showing 1 changed file with 31 additions and 31 deletions.
62 changes: 31 additions & 31 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,31 +1,31 @@
FROM python:3.12.3-slim as base

ENV PYTHONDONTWRITEBYTECODE=1

ENV PYTHONUNBUFFERED=1

WORKDIR /app

ARG UID=10001
RUN adduser \
--disabled-password \
--gecos "" \
--home "/nonexistent" \
--shell "/sbin/nologin" \
--no-create-home \
--uid "${UID}" \
appuser

RUN apt-get update && apt-get install -y git

RUN --mount=type=cache,target=/root/.cache/pip \
--mount=type=bind,source=requirements.txt,target=requirements.txt \
python -m pip install -r requirements.txt

COPY . .

RUN chown -R appuser:appuser /app

USER appuser

CMD python main.py
FROM python:3.10.9-slim as base

ENV PYTHONDONTWRITEBYTECODE=1

ENV PYTHONUNBUFFERED=1

WORKDIR /app

ARG UID=10001
RUN adduser \
--disabled-password \
--gecos "" \
--home "/nonexistent" \
--shell "/sbin/nologin" \
--no-create-home \
--uid "${UID}" \
appuser

RUN apt-get update && apt-get install -y git

RUN --mount=type=cache,target=/root/.cache/pip \
--mount=type=bind,source=requirements.txt,target=requirements.txt \
python -m pip install -r requirements.txt

COPY . .

RUN chown -R appuser:appuser /app

USER appuser

CMD python main.py

0 comments on commit 9ed3811

Please sign in to comment.