-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
8 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,14 @@ | ||
# Use the official Python 3.8 slim image as the base image | ||
FROM python:3.11-slim | ||
FROM ghcr.io/praekeltfoundation/python-base-nw:3.11-bullseye as build | ||
|
||
# Set the working directory within the container | ||
WORKDIR /api-flask | ||
RUN pip install poetry==1.8.4 | ||
COPY . ./ | ||
RUN poetry config virtualenvs.in-project true \ | ||
&& poetry install --no-dev --no-interaction --no-ansi | ||
|
||
# Copy the necessary files and directories into the container | ||
COPY src /api-flask/ | ||
COPY src/data/ /api-flask/data/ | ||
FROM ghcr.io/praekeltfoundation/python-base-nw:3.11-bullseye | ||
COPY --from=build .venv/ .venv/ | ||
COPY src src/ | ||
|
||
# Upgrade pip and install Python dependencies | ||
RUN pip3 install --upgrade pip && pip install --no-cache-dir -r requirements.txt | ||
|
||
# Expose port 5000 for the Flask application | ||
EXPOSE 5000 | ||
|
||
# Define the command to run the Flask application using Gunicorn | ||
CMD ["gunicorn", "application:app", "-b", "0.0.0.0:5000", "-w", "4"] |