-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
3 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
# FROM tiangolo/uvicorn-gunicorn-fastapi:python3.11-slim AS stage-1 | ||
FROM python:slim AS stage-1 | ||
FROM python:3.12-slim AS stage-1 | ||
|
||
LABEL org.opencontainers.image.source=https://github.com/ak7vv/hamframe | ||
LABEL org.opencontainers.image.authors="Christian AK7VV <[email protected]>" | ||
|
@@ -16,19 +16,12 @@ RUN apt-get update && \ | |
apt-get upgrade --yes && \ | ||
apt install --yes apt-utils | ||
|
||
# Get the Python version and store it in env | ||
RUN python -c "import sys; print(f'{sys.version_info.major}.{sys.version_info.minor}')" > /python_version | ||
|
||
RUN echo "/python_version: $(cat /python_version)" | ||
|
||
|
||
|
||
FROM stage-1 AS stage-2 | ||
|
||
ENV PYTHONUNBUFFERED=1 | ||
|
||
RUN echo "python version: $(cat /python_version)" | ||
|
||
WORKDIR /hamframe | ||
|
||
RUN apt-get install --yes \ | ||
|
@@ -52,9 +45,6 @@ FROM stage-2 AS stage-3 | |
|
||
ENV PYTHONUNBUFFERED=1 | ||
|
||
RUN echo "/python_version: $(cat /python_version)" | ||
|
||
|
||
WORKDIR /hamframe | ||
|
||
COPY requirements.txt . | ||
|
@@ -78,12 +68,10 @@ FROM stage-1 AS stage-4 | |
|
||
ENV PYTHONUNBUFFERED=1 | ||
|
||
RUN echo "/python_version: $(cat /python_version)" | ||
|
||
WORKDIR /hamframe | ||
|
||
COPY --from=stage-3 /usr/local/lib/python$(cat /python_version)/site-packages/ /usr/local/lib/python$(cat /python_version)/ | ||
COPY --from=stage-3 /usr/local/bin /usr/local/bin | ||
COPY --from=stage-3 /usr/local/lib/python3.12/site-packages/ /usr/local/lib/python3.12/ | ||
COPY --from=stage-3 /usr/local/bin/ /usr/local/bin | ||
|
||
# copy everything explicitly 'allowed' in .dockerignore | ||
COPY . . | ||
|