Skip to content

Conversation

@tomvothecoder
Copy link
Collaborator

@tomvothecoder tomvothecoder commented Nov 12, 2025

Description

This pull request containerizes the SimBoard technology stack, introducing Docker and Docker Compose configurations for both development and production environments. The changes migrate the project from Poetry to UV for Python dependency management, add comprehensive containerization support, and update documentation to reflect the new Docker-based workflows.

Key Changes

  • Docker Infrastructure: Added Dockerfiles for backend (Python 3.13 with UV) and frontend (Node with nginx), plus docker-compose.yml for production (with Traefik reverse proxy) and docker-compose.dev.yml for development (with hot-reload)
  • Dependency Management Migration: Migrated backend from Poetry to UV package manager, updating pyproject.toml to use PEP 621 project format with hatchling as the build backend
  • Development Workflow: Introduced separate bare-metal and Docker development environments with comprehensive Makefile commands for database management, container orchestration, and local development

Steps to Complete

  • Create Dockerfiles for backend
    • Backend
    • Frontend -- in progress
  • Add docker-compose.dev.yml to orchestrate development mode for backend and frontend
  • Add docker-compose.yml to orchestrate production mode for backend, frontend, and Traefik
  • Verify:
    • Frontend served at https://localhost
    • API requests proxy correctly to backend
    • CORS function as expected
  • Add setup documentation and Spin deployment notes
  • Fix pytest setup on VS Code

Checklist

  • Code follows project style guidelines
  • Self-reviewed code
  • No new warnings
  • Tests added or updated (if needed)
  • All tests pass (locally and CI/CD)
  • Documentation/comments updated (if needed)
  • Breaking change noted (if applicable)

Deployment Notes (if any)

@tomvothecoder tomvothecoder force-pushed the devops/23-containerization branch from 3999fef to c8fb921 Compare December 1, 2025 22:29
@tomvothecoder tomvothecoder marked this pull request as ready for review December 3, 2025 22:36
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request containerizes the SimBoard technology stack, introducing Docker and Docker Compose configurations for both development and production environments. The changes migrate the project from Poetry to UV for Python dependency management, add comprehensive containerization support, and update documentation to reflect the new Docker-based workflows.

Key Changes

  • Docker Infrastructure: Added Dockerfiles for backend (Python 3.13 with UV) and frontend (Node with nginx), plus docker-compose.yml for production (with Traefik reverse proxy) and docker-compose.dev.yml for development (with hot-reload)
  • Dependency Management Migration: Migrated backend from Poetry to UV package manager, updating pyproject.toml to use PEP 621 project format with hatchling as the build backend
  • Development Workflow: Introduced separate bare-metal and Docker development environments with comprehensive Makefile commands for database management, container orchestration, and local development

Reviewed changes

Copilot reviewed 24 out of 28 changed files in this pull request and generated 10 comments.

Show a summary per file
File Description
backend/Dockerfile Multi-stage build for Python backend using UV, with separate builder and runtime stages
backend/pyproject.toml Migrated from Poetry to UV format with PEP 621 project metadata and hatchling build backend
backend/Makefile Updated commands to use UV instead of Poetry for dependency management and execution
backend/.env.example Enhanced configuration with Docker-specific settings and clearer documentation
backend/README.md Simplified to reference root documentation and containerized setup
backend/app/main.py Added /health endpoint for Docker healthchecks
backend/app/core/config.py Updated cookie name from "simscope_auth" to "simboard_auth" and added extra="ignore"
backend/app/scripts/seed.py Added OAuth user creation with GitHub-style authentication for development seeding
backend/app/scripts/rollback_seed.py Extended to clean up user and OAuth account data
backend/tests/conftest.py Updated database name reference in docstring from "earthframe_test" to "simboard_test"
backend/.dockerignore Added to exclude unnecessary files from Docker build context
frontend/Dockerfile Multi-stage build with Node 24 for building and nginx for serving static assets
frontend/nginx.conf Added comprehensive nginx configuration with gzip, caching, SPA routing, and security headers
frontend/nginx-backend-not-found.conf Added configuration to block backend routes on frontend domain
frontend/.env.example Added configuration template for frontend with VITE_API_BASE_URL
frontend/README.md Simplified to reference root documentation
docker-compose.yml Production orchestration with Traefik, PostgreSQL, backend, and frontend services
docker-compose.dev.yml Development orchestration with hot-reload, debugpy support, and volume mounting
Makefile Significantly expanded with Docker commands, database management, and comprehensive help
README.md Major rewrite with Docker-first approach, separate bare-metal and Docker quickstart guides
.env.example Added root-level environment variables for Traefik and Docker image configuration
.dockerignore Added root-level Docker ignore file
.vscode/simboard.code-workspace Added Docker attach debugger configuration
.gitignore Added .pnpm-store and workspace file to exclusions
.github/ISSUE_TEMPLATE/*.yml Updated project name references from "EarthFrame" to "SimBoard"
Comments suppressed due to low confidence (1)

.vscode/simboard.code-workspace:74

  • The localRoot path mapping is incorrect. It uses ${workspaceFolder}/../backend but since the workspace file is in .vscode/ and the folders configuration shows the backend is at ../backend, this should be ${workspaceFolder}/backend (without the extra ..) to properly map to the backend directory.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@tomvothecoder tomvothecoder requested a review from Copilot December 5, 2025 19:36
@tomvothecoder tomvothecoder merged commit 4dfded0 into E3SM-Project:dev Dec 5, 2025
4 checks passed
@tomvothecoder tomvothecoder deleted the devops/23-containerization branch December 5, 2025 19:46
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 24 out of 28 changed files in this pull request and generated 14 comments.

Comments suppressed due to low confidence (1)

.vscode/simboard.code-workspace:74

  • The localRoot path mapping is incorrect. It uses ${workspaceFolder}/../backend which assumes the workspace folder is inside a subdirectory, but based on the folder structure in the workspace file, ${workspaceFolder} likely refers to the root directory. This should be ${workspaceFolder}/backend instead to correctly map the local backend directory to the container's /app directory.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

- traefik.http.services.${STACK_NAME:-simboard}-backend.loadbalancer.server.port=8000
- traefik.http.routers.${STACK_NAME:-simboard}-backend-http.rule=Host(`api.${DOMAIN}`)
- traefik.http.routers.${STACK_NAME:-simboard}-backend-http.entrypoints=http
- traefik.http.routers.${STACK_NAME:-simboard}-backend-http.middlewares=https-redirect
Copy link

Copilot AI Dec 5, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Traefik label references an https-redirect middleware that is not defined anywhere in this docker-compose.yml file. This will cause the HTTP to HTTPS redirect to fail. You need to add a middleware definition, for example: - traefik.http.middlewares.https-redirect.redirectscheme.scheme=https and - traefik.http.middlewares.https-redirect.redirectscheme.permanent=true

Copilot uses AI. Check for mistakes.
run:
@echo "$(GREEN)Starting FastAPI server...$(NC)"
poetry run uvicorn $(APP_NAME) --host $(HOST) --port $(PORT)
fastapi run $(APP_NAME) --host $(HOST) --port $(PORT)
Copy link

Copilot AI Dec 5, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The command uses fastapi run without the uv run prefix, but since UV is now the dependency manager, all Python commands should be prefixed with uv run to ensure they run in the correct virtual environment. This should be uv run fastapi run $(APP_NAME) --host $(HOST) --port $(PORT) for consistency with other commands in this Makefile.

Copilot uses AI. Check for mistakes.
tomvothecoder added a commit to tomvothecoder/simboard that referenced this pull request Dec 5, 2025
- Add `uv run` to `backend/Makefile` commands
- Update `.env.example` note about configuring postgres
- Update `README.md` note about configuring postgres
- Remove erroneous return user logic in `seed.py`
- Remove overly-strict nginx config
Copilot AI mentioned this pull request Dec 5, 2025
7 tasks
tomvothecoder added a commit that referenced this pull request Dec 9, 2025
- Standardized all Python commands in `backend/Makefile` to use `uv run` prefix for consistent dependency management
- Fixed shell variable scoping issues in the root `Makefile` by wrapping the `start` target commands in a subshell
- Improved PostgreSQL configuration documentation in `.env.example` and `README.md` for better developer onboarding
tomvothecoder added a commit that referenced this pull request Dec 16, 2025
- **Docker Infrastructure**: Added Dockerfiles for backend (Python 3.13 with UV) and frontend (Node with nginx), plus docker-compose.yml for production (with Traefik reverse proxy) and docker-compose.dev.yml for development (with hot-reload)
- **Dependency Management Migration**: Migrated backend from Poetry to UV package manager, updating pyproject.toml to use PEP 621 project format with hatchling as the build backend
- **Development Workflow**: Introduced separate bare-metal and Docker development environments with comprehensive Makefile commands for database management, container orchestration, and local development
tomvothecoder added a commit that referenced this pull request Dec 16, 2025
- Standardized all Python commands in `backend/Makefile` to use `uv run` prefix for consistent dependency management
- Fixed shell variable scoping issues in the root `Makefile` by wrapping the `start` target commands in a subshell
- Improved PostgreSQL configuration documentation in `.env.example` and `README.md` for better developer onboarding
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant