- New template: user-template-dictionary with Flask backend - Features: Add/Edit/Delete words, SQLite database per user - Persistent storage: Docker Volumes mount to /data/ - Modern HTML/CSS/JS Frontend with error handling - REST API: GET/POST/PUT/DELETE endpoints - Health checks and comprehensive logging - Comprehensive documentation in docs/templates/DICTIONARY_TEMPLATE.md - Updated templates.json and .env.example Files: - user-template-dictionary/Dockerfile - user-template-dictionary/app.py - user-template-dictionary/requirements.txt - user-template-dictionary/templates/index.html - docs/templates/DICTIONARY_TEMPLATE.md - templates.json (updated) - .env.example (updated)
25 lines
572 B
Docker
25 lines
572 B
Docker
FROM python:3.11-slim
|
|
|
|
WORKDIR /app
|
|
|
|
# Abhängigkeiten installieren
|
|
COPY requirements.txt .
|
|
RUN pip install --no-cache-dir -r requirements.txt
|
|
|
|
# App-Code
|
|
COPY app.py .
|
|
COPY templates/ templates/
|
|
|
|
# Daten-Verzeichnis für SQLite Datenbank (wird als Volume gemountet)
|
|
RUN mkdir -p /data && chmod 755 /data
|
|
|
|
# Port 8080 exponieren (unprivileged)
|
|
EXPOSE 8080
|
|
|
|
# Health Check
|
|
HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \
|
|
CMD python -c "import requests; requests.get('http://localhost:8080/health')" || exit 1
|
|
|
|
# Starten
|
|
CMD ["python", "app.py"]
|