-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile_gunicorn
More file actions
56 lines (43 loc) · 1.45 KB
/
Dockerfile_gunicorn
File metadata and controls
56 lines (43 loc) · 1.45 KB
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
# Use official Python 3.11 image
FROM python:3.11
# Metadata
LABEL Name="SynAnno" Version="1.0.0"
# Set the working directory
WORKDIR /app
# Upgrade pip
RUN pip install --no-cache-dir --upgrade pip
# Install system dependencies (Only if needed)
RUN apt-get update && apt-get install -y \
qtbase5-dev \
qtchooser \
qt5-qmake \
qttools5-dev-tools \
curl \
&& rm -rf /var/lib/apt/lists/*
# Install Rust (if needed)
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
ENV PATH="/root/.cargo/bin:${PATH}"
# Verify Cargo version (if needed)
RUN cargo --version
RUN pip install uv
RUN uv pip install --system --no-cache-dir torch torchvision --index-url https://download.pytorch.org/whl/cpu
RUN uv pip install --system --no-cache-dir torchsummary
RUN uv pip install --system --no-cache-dir tqdm gunicorn
# Copy application code, configuration, and setup files
COPY setup.py /app/
COPY synanno /app/synanno
COPY run_production.py /app/
COPY h01/h01_104_materialization.csv /app/h01/h01_104_materialization.csv
# Install required Python packages
RUN uv pip install --system --no-cache-dir -e .
# Expose necessary ports
EXPOSE 80 9015
# Set environment variables
ENV DEBUG_APP="False"
ENV APP_IP="0.0.0.0"
ENV NG_IP="0.0.0.0"
ENV NG_PORT="9015"
ENV APP_PORT="80"
ENV EXECUTION_ENV="docker"
# Start the Flask application using Gunicorn (on port 80)
CMD ["gunicorn", "-w", "1", "--timeout", "300", "-b", "0.0.0.0:80", "run_production:app"]