You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
20 lines
521 B
20 lines
521 B
# Official Python image
|
|
FROM python:3.12-slim
|
|
|
|
# Set workdir
|
|
WORKDIR /app
|
|
|
|
# Copy the file with the requirements
|
|
COPY requirements.txt .
|
|
|
|
# Install the package dependencies in the requirements file.
|
|
RUN pip install --no-cache-dir --upgrade -r requirements.txt
|
|
|
|
# Copy the FastAPI app folder in the container
|
|
COPY . .
|
|
|
|
# Expose API port
|
|
EXPOSE 80
|
|
|
|
# Runs the stub script & launches the uvicorn server (command from offical FastAPI documentation)
|
|
CMD ["sh", "-c", "python3 app/stub.py && fastapi run app/main.py --port 80"] |