Files
docker-build-exercise/Dockerfile.example
2023-01-02 16:32:12 +01:00

22 lines
567 B
Docker
Executable File

FROM python:3.9.9-slim-bullseye
#FROM python:3.9.9-bullseye
# Build the image also using the other FROM line, the difference is in the content and size of the image,
# 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 .
# The next line says "app:api" and not "app:app" !
CMD ["uvicorn", "app:api", "--host", "0.0.0.0", "--port", "8000"]