-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile
More file actions
33 lines (26 loc) · 805 Bytes
/
Copy pathDockerfile
File metadata and controls
33 lines (26 loc) · 805 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
30
31
32
33
FROM python:3.11-slim
# Install system dependencies
RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential \
git \
libglib2.0-0 \
libsm6 \
libxrender1 \
libxext6 \
libjpeg-dev \
zlib1g-dev \
&& rm -rf /var/lib/apt/lists/*
# Set workdir
WORKDIR /app
# Copy project files
COPY . /app
# Use pip and install requirements
RUN python -m pip install --upgrade pip setuptools wheel
RUN pip install -r requirements.txt
# Expose the port used by the Flask app
EXPOSE 8050
# Recommended cache dir for huggingface model files (can be mounted at runtime)
ENV HF_HOME=/root/.cache/huggingface
ENV HF_HUB_OFFLINE=0
# Default command: run app with gunicorn
CMD ["gunicorn", "-b", "0.0.0.0:8050", "webapp.app:app", "--workers", "1", "--threads", "4"]