new comments

This commit is contained in:
erik 2025-05-24 18:33:03 +00:00
parent b2f649a489
commit 09404da121
13 changed files with 430 additions and 70 deletions

View file

@ -1,14 +1,23 @@
# Dockerfile for Dereth Tracker application
# Base image: lightweight Python runtime
FROM python:3.12-slim
# Set working directory
## Set application working directory
WORKDIR /app
# Upgrade pip and install Python dependencies
# Upgrade pip and install required Python packages without caching
RUN python -m pip install --upgrade pip && \
pip install --no-cache-dir fastapi uvicorn pydantic websockets databases[postgresql] sqlalchemy alembic psycopg2-binary
pip install --no-cache-dir \
fastapi \
uvicorn \
pydantic \
websockets \
databases[postgresql] \
sqlalchemy \
alembic \
psycopg2-binary
# Copy application code
## Copy application source code and migration scripts into container
COPY static/ /app/static/
COPY main.py /app/main.py
COPY db.py /app/db.py
@ -16,17 +25,23 @@ COPY db_async.py /app/db_async.py
COPY alembic.ini /app/alembic.ini
COPY alembic/ /app/alembic/
COPY Dockerfile /Dockerfile
# Expose the application port
## Expose the application port to host
EXPOSE 8765
# Default environment variables (override as needed)
## Default environment variables for application configuration
ENV DATABASE_URL=postgresql://postgres:password@db:5432/dereth \
DB_MAX_SIZE_MB=2048 \
DB_RETENTION_DAYS=7 \
DB_MAX_SQL_LENGTH=1000000000 \
DB_MAX_SQL_VARIABLES=32766 \
DB_WAL_AUTOCHECKPOINT_PAGES=1000 \
SHARED_SECRET=your_shared_secret
SHARED_SECRET=your_shared_secret # Secret for plugin authentication
# Run the FastAPI application with Uvicorn
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8765", "--reload", "--workers", "1"]
## Launch the FastAPI app using Uvicorn
CMD [
"uvicorn", "main:app",
"--host", "0.0.0.0",
"--port", "8765",
"--reload", # auto-restart on code changes
"--workers", "1"
]