Files
docker-build-exercise/Dockerfile.python:3.9.9-bullseye
Marco Verleun e6c755acc8
Some checks failed
renovate / image-build (push) Failing after 1m43s
renovate / renovate (push) Successful in 27s
test
2024-02-18 20:57:35 +01:00

23 lines
511 B
Docker
Executable File

FROM python:3.9.9-bullseye
# COPY will place the files inside this directory
WORKDIR /usr/src/app
# This value has to match the value on line 21
EXPOSE 8000
RUN apt-get update && apt-get upgrade -y && rm -rf /var/lib/apt/lists/*
COPY requirements.txt .
# Install the required python packages
RUN pip install -r requirements.txt
# Add the python app to the image
COPY app.py .
USER 1000
# The next line says "app:api" and not "app:app" !
CMD ["uvicorn", "app:api", "--host", "0.0.0.0", "--port", "8000"]