2026-03-28 23:20:40 -05:00
|
|
|
FROM python:3.12-slim
|
|
|
|
|
WORKDIR /app
|
2026-03-29 09:18:42 -05:00
|
|
|
RUN pip install --no-cache-dir bcrypt
|
|
|
|
|
RUN adduser --disabled-password --no-create-home appuser
|
|
|
|
|
RUN mkdir -p /app/data && chown -R appuser /app/data
|
|
|
|
|
COPY --chown=appuser server.py config.py database.py sessions.py proxy.py responses.py auth.py dashboard.py command.py ./
|
|
|
|
|
COPY --chown=appuser integrations/ ./integrations/
|
2026-03-28 23:20:40 -05:00
|
|
|
EXPOSE 8100
|
Refactor gateway into modular architecture
Split 1878-line server.py into 15 focused modules:
- config.py: all env vars and constants
- database.py: schema, init, seed logic
- sessions.py: session/token CRUD
- proxy.py: proxy_request, SERVICE_MAP, resolve_service
- responses.py: ResponseMixin for handler helpers
- auth.py: login/logout/register handlers
- dashboard.py: dashboard, apps, connections, pinning
- command.py: AI command bar
- integrations/booklore.py: auth, books, cover, import
- integrations/kindle.py: send-to-kindle, file finder
- integrations/karakeep.py: save/delete bookmarks
- integrations/qbittorrent.py: download status
- integrations/image_proxy.py: external image proxy
server.py is now thin routing only (~344 lines).
All routes, methods, status codes, and responses preserved exactly.
Added PYTHONUNBUFFERED=1 to Dockerfile for live logging.
2026-03-29 00:14:46 -05:00
|
|
|
ENV PYTHONUNBUFFERED=1
|
2026-03-29 09:18:42 -05:00
|
|
|
HEALTHCHECK --interval=30s --timeout=5s --retries=3 CMD python3 -c "import urllib.request; urllib.request.urlopen('http://localhost:8100/api/health', timeout=3)" || exit 1
|
|
|
|
|
USER appuser
|
2026-03-28 23:20:40 -05:00
|
|
|
CMD ["python3", "server.py"]
|