-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
32 lines (21 loc) · 810 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
FROM python:3.11-slim
# Install Node.js
RUN apt-get update && apt-get install -y nodejs npm \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
ENV PYTHONUNBUFFERED=1 \
PYTHONPATH=/
WORKDIR /app
# Install Python dependencies
COPY app/requirements.txt /app/
RUN pip install --no-cache-dir -r /app/requirements.txt
# Install Node.js dependencies and build TailwindCSS
COPY app/package*.json /app/
RUN npm install
COPY app/ /app/
# Build TailwindCSS
RUN npx tailwindcss -i ./static/css/input.css -o ./static/css/styles.css --minify
RUN groupadd --system appuser && useradd --system --create-home --gid appuser appuser
USER appuser
EXPOSE 5000
CMD ["gunicorn", "--bind", "0.0.0.0:5000", "--workers", "4", "--worker-class", "gthread", "--threads", "2", "--timeout", "60", "app:create_app()"]