Prerequisites
- Docker 24.x or higher
- Docker Compose (optional, for simplified workflows)
.envfile configured with all required variables
Docker Architecture
Estudio Three uses a multi-stage Docker build:- Build stage: Compiles the Vite application with embedded environment variables
- Production stage: Serves the static build with Nginx (unprivileged)
Management Scripts
Estudio Three includes interactive management scripts for both Unix and Windows:Linux/macOS: manage.sh
Select option
The interactive menu provides:
- [1] Lanzar Rápido: Quick start (skips rebuild if image exists)
- [2] Construcción Total: Force rebuild and launch
- [3] Terminal Shell: Access container shell
- [4] Ver Registros: View live logs
- [5] Detener Sistema: Stop container
- [6-8] Dev Tools: Development server, tests, cache cleanup
- [9] Info Sistema: System diagnostics
- [10] Limpieza Docker: Remove image and container
Windows: manage.ps1
Docker detection
The script automatically detects:
- Docker Desktop (Windows)
- Docker in WSL (fallback)
Manual Docker Commands
If you prefer manual control over the Docker workflow:Building the Image
Build time typically takes 2-5 minutes depending on your system and network speed
Running the Container
http://localhost:8080
Container Management
Docker Compose
For more complex setups, use Docker Compose:docker-compose.yml file includes two profiles:
- dev: Runs
npm run devwith source volume mounts - prod: Serves production build with Nginx
Port Mappings
| Container Port | Host Port | Purpose |
|---|---|---|
| 8080 | 8080 | Production Nginx server |
| 5173 | 5173 | Development Vite server |
The production build uses
nginxinc/nginx-unprivileged:alpine which runs on port 8080 instead of the standard 80 for securityVolumes and Persistence
The Docker image includes:- Static assets: Built application in
/usr/share/nginx/html - Nginx config: Custom configuration at
/etc/nginx/conf.d/default.conf - No persistent data: All data is stored in Supabase
Production Considerations
Security
Use unprivileged images
The Dockerfile uses
nginxinc/nginx-unprivileged:alpine which runs as a non-root userDon't expose service_role key
Never pass Supabase
service_role key to the Docker build. Only use anon key.Performance Optimization
Health Checks
Add health checks to your Docker run command:Logging
Configure log drivers for centralized logging:Deployment to Cloud
AWS ECS/Fargate
Google Cloud Run
Azure Container Instances
Troubleshooting
Blank screen after deployment
Problem: Application loads but shows blank screen Cause: Environment variables not provided at build time Solution: Rebuild the image with--build-arg for all VITE_ variables
”Cannot find module” errors
Problem: Build fails with missing dependencies Solution: Ensurepackage-lock.json is committed and npm ci is used (not npm install)
Port already in use
Problem:docker run fails with “port is already allocated”
Solution:
Container exits immediately
Problem: Container starts but exits immediately Solution: Check logs for errors- Nginx configuration syntax error
- Missing build files in
/usr/share/nginx/html
Permission denied errors
Problem: Container can’t write to filesystem Solution: The unprivileged Nginx runs as usernginx (UID 101). Ensure files are readable:
Next Steps
- Configure environment variables
- Set up Supabase database
- Deploy to Vercel (alternative deployment method)
For most users, Vercel deployment is simpler and includes automatic SSL, CDN, and serverless functions out of the box