Nginx for Local Development
Overview
The docker-compose.nginx.yml file provides an optional nginx container for local development. This is NOT used on AWS (which uses bare metal nginx).
When to Use
Use nginx container when you want to access services via friendly domains locally:
http://amarmascotas.local.com→ amarhttp://soleprint.local.com→ soleprint + services
Setup
1. Generate Nginx Config
cd ../ctrl/server
./setup.sh --local
This creates /tmp/core_room.conf with your local domain routing.
2. Ensure /etc/hosts is configured
# Should already be there, but verify:
grep "127.0.0.1.*amarmascotas.local.com" /etc/hosts
grep "127.0.0.1.*soleprint.local.com" /etc/hosts
3. Stop bare metal nginx (if running)
sudo systemctl stop nginx
# Optional: disable so it doesn't start on boot
sudo systemctl disable nginx
4. Start services WITH nginx
cd ../ctrl
./start.sh --with-nginx
# OR manually:
cd ../soleprint
docker compose -f docker-compose.yml -f docker-compose.nginx.yml up -d
Without Nginx (Default)
If you don't use nginx, services are accessed via ports:
http://localhost:3000→ amar frontendhttp://localhost:8000→ amar backendhttp://localhost:13000→ soleprinthttp://localhost:13001→ arteryhttp://localhost:13002→ albumhttp://localhost:13003→ ward
The default docker-compose.yml exposes these ports, so it works either way.
Switching Between Nginx and Direct Access
To use nginx routing:
# Stop direct port access
cd ../ctrl && ./stop.sh
# Start with nginx
./start.sh --with-nginx
To go back to direct ports:
# Stop nginx version
cd ../soleprint
docker compose -f docker-compose.yml -f docker-compose.nginx.yml down
# Start without nginx
cd ../ctrl && ./start.sh
AWS Production
On AWS, do NOT use docker-compose.nginx.yml. The AWS setup uses bare metal nginx configured via ctrl/server/setup.sh --production.
Troubleshooting
Port 80 already in use:
# Check what's using it
ss -tlnp | grep :80
# If it's nginx bare metal
sudo systemctl stop nginx
# If it's another container
docker ps | grep :80
docker stop <container_name>
Config not found error:
# Make sure you ran setup first
cd ../ctrl/server && ./setup.sh --local
# Verify config exists
ls -la /tmp/core_room.conf
DNS not resolving:
# Check /etc/hosts
cat /etc/hosts | grep local.com
# Test DNS
ping -c 1 amarmascotas.local.com