Files
docker-build-exercise/Dockerfile.python:3.9.9-bullseye
Renovate Bot 03d6940f29
Some checks failed
build / image-build (push) Failing after 16m9s
renovate / renovate (push) Has been cancelled
chore(deps): update python docker tag to v3.13.1
2024-12-08 00:40:15 +00:00

25 lines
492 B
Docker
Executable File

FROM python:3.13.1-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 .
# Test with PyTest
RUN pytest app.py
# Run non root
USER 1000
# The next line says "app:api" and not "app:app" !
CMD ["uvicorn", "app:api", "--host", "0.0.0.0", "--port", "8000"]