Files
minmal-file-cloud-email-pim…/Dockerfile
T
Stefan Hacker dca064427e feat(config): TZ + NTP_SERVER in .env mit sinnvollen Defaults
- .env / .env.example: TZ=Europe/Berlin und NTP_SERVER=ptbtime1.ptb.de
  (offizielle deutsche Zeitreferenz, hohe Verfuegbarkeit)
- app/__init__.py setzt prozessweite Zeitzone frueh via os.environ+tzset
- Leichtgewichtiger SNTP-Client (pure socket, keine deps) prueft den
  Uhr-Offset beim Start im Hintergrund-Thread und warnt bei Abweichung >5s
- Dockerfile installiert tzdata und ENV TZ=Europe/Berlin als Fallback

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-14 15:15:57 +02:00

48 lines
1.2 KiB
Docker

# Stage 1: Build frontend
FROM node:22-slim AS frontend-build
WORKDIR /build
COPY frontend/package*.json ./
RUN npm ci
COPY frontend/ ./
RUN npm run build
# Stage 2: Production
FROM python:3.11-slim
WORKDIR /app
# Install system dependencies
RUN apt-get update && apt-get install -y --no-install-recommends \
gcc \
tzdata \
&& rm -rf /var/lib/apt/lists/*
# Install Python dependencies
COPY backend/requirements.txt ./
RUN pip install --no-cache-dir -r requirements.txt gunicorn
# Copy backend
COPY backend/ ./
# Copy frontend build
COPY --from=frontend-build /build/dist ./static
# Create data directory
RUN mkdir -p /app/data/files
# Environment
ENV FLASK_ENV=production
ENV TZ=Europe/Berlin
ENV DATABASE_PATH=/app/data/minicloud.db
ENV UPLOAD_PATH=/app/data/files
EXPOSE 5000
# Single worker with many threads. The SSE broadcaster lives in process
# memory - mit mehreren Workern wuerden Events den Empfaenger nicht
# erreichen wenn Sender und Empfaenger auf verschiedenen Workern haengen.
# 32 Threads = bis zu 32 gleichzeitige Requests/SSE-Streams.
CMD ["gunicorn", "--bind", "0.0.0.0:5000", \
"--worker-class", "gthread", "--workers", "1", "--threads", "32", \
"--timeout", "120", "--keep-alive", "65", \
"wsgi:application"]