Skip to content

Commit fadd02f

Browse files
committed
Update docker python versions
Signed-off-by: Federico Busetti <[email protected]>
1 parent 27f5414 commit fadd02f

File tree

1 file changed

+9
-10
lines changed

1 file changed

+9
-10
lines changed

Dockerfile

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
ARG PYTHON_VERSION=3.11
2-
FROM python:$PYTHON_VERSION-slim as base
1+
ARG PYTHON_VERSION=3.12
2+
FROM python:$PYTHON_VERSION-slim AS base
33
ARG UID=2000
44
ARG GID=2000
55
RUN addgroup --gid $GID nonroot && \
@@ -26,7 +26,7 @@ RUN pip install --no-cache-dir -U poetry
2626
# for binaries installed in virtual environments
2727
ENTRYPOINT ["poetry", "run"]
2828

29-
FROM base as base_builder
29+
FROM base AS base_builder
3030
# Install build system requirements (gcc, library headers, etc.)
3131
# for compiled Python requirements like psycopg2
3232
RUN apt-get update \
@@ -44,23 +44,23 @@ COPY --chown=nonroot:nonroot poetry.lock .
4444
COPY --chown=nonroot:nonroot Makefile .
4545

4646
# Test image, contains all files and dependencies
47-
FROM base_builder as dev
47+
FROM base_builder AS dev
4848
COPY --chown=nonroot:nonroot . .
4949
RUN make dev-dependencies
5050
# Note that opentelemetry doesn't play well together with uvicorn reloader
5151
# when signals are propagated, we disable it in dev image default CMD
5252
CMD ["uvicorn", "http_app:create_app", "--host", "0.0.0.0", "--port", "8000", "--factory", "--reload"]
5353

5454
# Installs requirements to run production celery application
55-
FROM base_builder as celery_builder
55+
FROM base_builder AS celery_builder
5656
RUN poetry install --no-root
5757

5858
# Installs requirements to run production http application
59-
FROM base_builder as http_builder
59+
FROM base_builder AS http_builder
6060
RUN poetry install --no-root --with http
6161

6262
# Copy the shared python packages
63-
FROM base as base_app
63+
FROM base AS base_app
6464
USER nonroot
6565
RUN poetry config virtualenvs.path /poetryvenvs
6666
COPY --chown=nonroot:nonroot pyproject.toml .
@@ -73,16 +73,15 @@ COPY --chown=nonroot:nonroot src/alembic.ini .
7373
COPY --chown=nonroot:nonroot Makefile .
7474

7575
# Copy the http python package and requirements from relevant builder
76-
FROM base_app as http_app
76+
FROM base_app AS http_app
7777
COPY --from=http_builder /poetryvenvs /poetryvenvs
7878
COPY --chown=nonroot:nonroot src/http_app ./http_app
7979
# Run CMD using array syntax, so it's uses `exec` and runs as PID1
8080
CMD ["opentelemetry-instrument", "uvicorn", "http_app:create_app", "--host", "0.0.0.0", "--port", "8000", "--factory"]
8181

8282
# Copy the celery python package and requirements from relevant builder
83-
FROM base_app as celery_app
83+
FROM base_app AS celery_app
8484
COPY --from=celery_builder /poetryvenvs /poetryvenvs
8585
COPY --chown=nonroot:nonroot src/celery_worker ./celery_worker
86-
RUN ls
8786
# Run CMD using array syntax, so it's uses `exec` and runs as PID1
8887
CMD ["opentelemetry-instrument", "celery", "-A", "celery_worker:app", "worker", "-l", "INFO"]

0 commit comments

Comments
 (0)