-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
29 lines (21 loc) · 807 Bytes
/
Copy pathDockerfile
File metadata and controls
29 lines (21 loc) · 807 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# Use the official Python slim image as the base image
FROM python:3.10-slim
# Set the working directory inside the container
WORKDIR /app
# Copy requirements.txt and install dependencies globally
COPY requirements.txt .
RUN pip install --upgrade pip && pip install -r requirements.txt
# Copy the app code to the container
COPY . .
# Run the art trimming script
RUN python3 scripts/trim_art.py
# Expose port 5000 for the Flask app
EXPOSE 5000
# Bake the git commit into the env
ARG GIT_COMMIT
ENV GIT_COMMIT=$GIT_COMMIT
# Healthcheck to ensure the service is up
# HEALTHCHECK --interval=30s --timeout=10s --retries=3 \
# CMD curl --fail http://localhost:5000/ || exit 1
# Run Gunicorn without virtual environment
ENTRYPOINT ["gunicorn", "-b", "0.0.0.0:5000", "-w", "4", "-t", "120", "wsgi:app"]