Files
docker-build-exercise/Dockerfile.python:3.9.9-slim-bullseye
Marco Verleun df20249dbb
Some checks failed
renovate / renovate (push) Waiting to run
build / image-build (push) Has been cancelled
One more image
2024-02-19 07:45:06 +01:00

21 lines
452 B
Docker
Executable File

FROM python:3.9.9-slim-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
COPY requirements.txt .
# Install the required python packages
RUN pip install -r requirements.txt
# Add the python app to the image
COPY app.py .
RUN pytest1 app.py
# The next line says "app:api" and not "app:app" !
CMD ["uvicorn", "app:api", "--host", "0.0.0.0", "--port", "8000"]