-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathDockerfile
More file actions
33 lines (21 loc) · 825 Bytes
/
Dockerfile
File metadata and controls
33 lines (21 loc) · 825 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 node:20-slim AS builder
WORKDIR /build
COPY app/package*.json ./
COPY app/tailwind.config.js ./
COPY app/templates ./templates
COPY app/static/css/input.css ./static/css/input.css
RUN npm install
RUN npx tailwindcss -i ./static/css/input.css -o ./static/css/styles.css --minify
FROM python:3.12-slim
ENV PYTHONUNBUFFERED=1
ENV PYTHONPATH=/
WORKDIR /app
COPY app/requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
COPY app/ .
COPY --from=builder /build/static/css/styles.css ./static/css/styles.css
RUN groupadd --system appuser && useradd --system --create-home --gid appuser appuser
RUN chown -R appuser:appuser /app
USER appuser
EXPOSE 5000
CMD ["gunicorn", "--bind", "0.0.0.0:5000", "--workers", "4", "--worker-class", "gthread", "--threads", "2", "--timeout", "60", "app:create_app()"]