Phase 9: Docker Deployment Setup - docker-compose with logging and port mapping

- Updated docker-compose.yml with port 8990:8000 mapping
- Fixed environment variables to match current .env configuration
- Added third PostgreSQL database (postgres_mirror) for mirror/sync data
- Added robust JSON file logging for all containers (10MB max, 3 files)
- Updated PostgreSQL credentials to use postgres/postgres
- Added health checks for all services
- Enhanced Dockerfile with logging environment variables
- Created .env.docker documentation file with deployment checklist
- Docker build verified successfully
This commit is contained in:
2026-08-18 03:53:35 +00:00
parent 1df04aea52
commit ad037de48d
3 changed files with 168 additions and 27 deletions
+9 -1
View File
@@ -45,9 +45,17 @@ RUN chmod +x /app/scripts/*.py
COPY --chown=appuser:appuser .env.example ./.env.example
COPY --chown=appuser:appuser pyproject.toml ./
ENV PYTHONPATH=/app
# Python environment variables for proper logging
ENV PYTHONUNBUFFERED=1
ENV PYTHONDONTWRITEBYTECODE=1
ENV PYTHONPATH=/app
# Logging configuration
ENV MTG_LOG_LEVEL=INFO
ENV MTG_LOG_FORMAT=json
# Create logging directory with proper permissions
RUN mkdir -p /app/logs && chown appuser:appuser /app/logs
HEALTHCHECK --interval=30s --timeout=20s --start-period=5s --retries=3 \
CMD curl -f http://localhost:8000/health || exit 1