-
Notifications
You must be signed in to change notification settings - Fork 6
feat(setup): add docker compose config for deployment #14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…tion services with .dockerignore files
… API Docker configuration
There was a problem hiding this 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 PR adds comprehensive Docker containerization setup for an OpenLearn platform deployment. It provides both development and production Docker configurations for a multi-service architecture including web frontend, API backend, recommendation service, and database.
- Creates production and development Docker Compose configurations
- Adds Dockerfiles for web (Node.js/React), API (Node.js), and recommendation service (Python/FastAPI)
- Includes a comprehensive Makefile for development workflow management
Reviewed Changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| docker-compose.yml | Production Docker Compose config with service definitions and networking |
| docker-compose.dev.yml | Development Docker Compose config with hot-reload and dev settings |
| apps/web/Dockerfile | Multi-stage Dockerfile for React frontend with nginx production serving |
| apps/web/nginx.conf | Nginx configuration for production web service with security headers |
| apps/api/Dockerfile | Multi-stage Dockerfile for Node.js API with Prisma support |
| apps/api/start.sh | Startup script for API service with database wait and migrations |
| apps/recommendation-api/Dockerfile | Multi-stage Python Dockerfile for FastAPI recommendation service |
| Makefile | Comprehensive development workflow commands for Docker operations |
| Various .dockerignore files | Docker build context optimization for each service |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| #!/bin/sh | ||
|
|
||
| echo "Waiting for database to be ready..." | ||
| while ! nc -z postgres 5432; do |
Copilot
AI
Sep 2, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The hardcoded hostname 'postgres' makes the script less flexible. Consider using an environment variable like ${POSTGRES_HOST:-postgres} to allow configuration for different deployment scenarios.
| while ! nc -z postgres 5432; do | |
| while ! nc -z "${POSTGRES_HOST:-postgres}" 5432; do |
| ports: | ||
| - "5432" |
Copilot
AI
Sep 2, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The postgres port is exposed without host binding, which exposes it to the host network. Since this is for internal service communication only, consider removing the ports mapping entirely or bind to localhost with '127.0.0.1:5432:5432' if external access is needed.
| ports: | |
| - "5432" |
| ports: | ||
| - "6379" |
Copilot
AI
Sep 2, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The redis port is exposed without host binding, which exposes it to the host network. Since this is for internal service communication only, consider removing the ports mapping entirely or bind to localhost with '127.0.0.1:6379:6379' if external access is needed.
| ports: | |
| - "6379" |
| add_header X-XSS-Protection "1; mode=block" always; | ||
| add_header X-Content-Type-Options "nosniff" always; | ||
| add_header Referrer-Policy "no-referrer-when-downgrade" always; | ||
| add_header Content-Security-Policy "default-src 'self' http: https: data: blob: 'unsafe-inline'" always; |
Copilot
AI
Sep 2, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The Content-Security-Policy is too permissive with 'unsafe-inline' and allowing all http/https sources. Consider tightening this policy by specifying exact domains and removing 'unsafe-inline' if possible to improve security.
| add_header Content-Security-Policy "default-src 'self' http: https: data: blob: 'unsafe-inline'" always; | |
| add_header Content-Security-Policy "default-src 'self'; script-src 'self'; style-src 'self'; img-src 'self' data:; font-src 'self'; object-src 'none'; base-uri 'self';" always; |
No description provided.