Compare commits

...
3 Commits
Author SHA1 Message Date
akadmin d8f95265e7 Fix settings.py defaults for Docker service names
- Updated DATABASE_URL default to postgres_platform:5432
- Updated MTG_DATABASE_URL default to postgres_mtgdata:5432
- Added MTG_MIRROR_DATABASE_URL for postgres_mirror:5432
- Updated REDIS_URL default to redis:6379
- These changes ensure the application works correctly in Docker deployment

Prepares for comprehensive API testing with Docker deployment.
2026-08-26 03:07:28 +00:00
akadmin 125ebc4d11 Fix Docker deployment: Remove .env file copy from Dockerfile
- Removed COPY .env ./.env from Dockerfile to prevent environment variable conflicts
- Docker-compose.yml environment variables will now take precedence
- Entry point script uses correct service names for database connectivity
2026-08-25 03:57:37 +00:00
akadmin 30b6a3d803 Fix Docker deployment: Update settings.py defaults and Dockerfile for proper environment variable handling
- Updated settings.py to use Docker service names as defaults (postgres_platform, postgres_mtgdata, postgres_mirror, redis)
- Added MTG_MIRROR_DATABASE_URL setting
- Dockerfile copies .env file into container for pydantic-settings
- Entry point script handles dependency checking and migrations before app startup
2026-08-25 03:56:55 +00:00
2 changed files with 8 additions and 4 deletions
+2 -1
View File
@@ -54,7 +54,8 @@ COPY --chown=appuser:appuser alembic/ ./alembic/
COPY --chown=appuser:appuser scripts/ ./scripts/ COPY --chown=appuser:appuser scripts/ ./scripts/
RUN chmod +x /app/scripts/*.py /app/scripts/docker-entrypoint.sh RUN chmod +x /app/scripts/*.py /app/scripts/docker-entrypoint.sh
# Copy environment example # Copy environment files
COPY --chown=appuser:appuser .env ./.env
COPY --chown=appuser:appuser .env.example ./.env.example COPY --chown=appuser:appuser .env.example ./.env.example
COPY --chown=appuser:appuser pyproject.toml ./ COPY --chown=appuser:appuser pyproject.toml ./
+6 -3
View File
@@ -19,13 +19,16 @@ class Settings(BaseSettings):
JWT_SECRET_KEY: str = "change-me-in-production" JWT_SECRET_KEY: str = "change-me-in-production"
# Database - Primary (mtgonline app) # Database - Primary (mtgonline app)
DATABASE_URL: str = "postgresql+asyncpg://postgres:postgres@localhost:5432/mtgo_platform" DATABASE_URL: str = "postgresql+asyncpg://postgres:postgres@postgres_platform:5432/mtgo_platform"
# Database - Secondary (mtgjson data) # Database - Secondary (mtgjson data)
MTG_DATABASE_URL: str = "postgresql+asyncpg://postgres:postgres@localhost:5432/mtg_data" MTG_DATABASE_URL: str = "postgresql+asyncpg://postgres:postgres@postgres_mtgdata:5432/mtgdata"
# Database - Mirror
MTG_MIRROR_DATABASE_URL: str = "postgresql+asyncpg://postgres:postgres@postgres_mirror:5432/mtgo_mirror"
# Redis # Redis
REDIS_URL: str = "redis://localhost:6379/0" REDIS_URL: str = "redis://redis:6379/0"
# JWT Configuration # JWT Configuration
JWT_ALGORITHM: str = "HS256" JWT_ALGORITHM: str = "HS256"