Files
lair.moe/Dockerfile
T

47 lines
1.0 KiB
Docker
Raw Normal View History

2026-02-04 15:51:14 +03:00
FROM node:18-alpine AS sass-builder
2025-08-07 21:16:47 +03:00
2026-02-04 15:51:14 +03:00
RUN npm install -g sass@latest --omit=dev --no-fund --no-audit
2025-08-07 21:16:47 +03:00
WORKDIR /build
2026-01-17 18:55:25 +03:00
COPY ./blueprints ./blueprints
2026-02-04 15:51:14 +03:00
2026-01-17 18:55:25 +03:00
RUN sass ./blueprints:./blueprints \
2025-08-07 21:16:47 +03:00
--no-source-map \
2026-02-04 15:51:14 +03:00
--style=compressed \
--quiet
2025-08-06 17:31:20 +03:00
2025-08-07 21:16:47 +03:00
FROM python:3.11-slim
2025-08-06 17:31:20 +03:00
2026-02-04 15:51:14 +03:00
RUN apt-get update && \
apt-get install --no-install-recommends -y \
libmagic1 \
&& rm -rf /var/lib/apt/lists/*
2025-08-06 17:31:20 +03:00
WORKDIR /app
2026-02-04 15:51:14 +03:00
COPY requirements.txt .
RUN pip install --no-cache-dir --no-deps -r requirements.txt
2025-08-06 17:31:20 +03:00
COPY . .
2025-08-07 21:16:47 +03:00
2026-02-04 15:51:14 +03:00
COPY --from=sass-builder /build/blueprints/ ./blueprints/
RUN useradd -m -u 1001 appuser && \
chown -R appuser:appuser /app
USER appuser
2025-08-06 17:31:20 +03:00
2026-02-04 15:51:14 +03:00
ENV FLASK_ENV=production \
PYTHONUNBUFFERED=1 \
PYTHONDONTWRITEBYTECODE=1 \
PIP_NO_CACHE_DIR=1 \
PIP_DISABLE_PIP_VERSION_CHECK=1
2025-08-07 21:16:47 +03:00
2026-02-04 15:51:14 +03:00
CMD ["gunicorn", "app:app", \
"-b", "0.0.0.0:80", \
"--workers", "4", \
"--worker-class", "sync", \
"--worker-tmp-dir", "/dev/shm", \
"--access-logfile", "-", \
"--error-logfile", "-", \
"--log-level", "info"]