-
Notifications
You must be signed in to change notification settings - Fork 141
/
Copy pathDockerfile
36 lines (29 loc) · 852 Bytes
/
Dockerfile
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
# Dockerfile
FROM python:3.11-slim
WORKDIR /app
ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1
# Install system dependencies
RUN apt-get update \
&& apt-get install -y --no-install-recommends gcc python3-dev libpq-dev \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
# Install Python dependencies
COPY requirements-nginx.txt .
RUN pip install --no-cache-dir -r requirements-nginx.txt
RUN pip install gunicorn eventlet>=0.24.1
# Copy project files
COPY . .
# Create directories and set permissions
RUN mkdir -p db logs && \
chmod -R 777 db logs
# Command to run the application
CMD ["gunicorn", \
"--bind", "0.0.0.0:5000", \
"--worker-class", "eventlet", \
"--workers", "1", \
"--reload", \
"--log-level", "debug", \
"--access-logfile", "-", \
"--error-logfile", "-", \
"app:app"]