Skip to content

Commit

Permalink
Update dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
erikh360 committed Nov 25, 2024
1 parent ee3d070 commit abdaf25
Showing 1 changed file with 8 additions and 12 deletions.
20 changes: 8 additions & 12 deletions Dockerfile
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"]

0 comments on commit abdaf25

Please sign in to comment.