This is my current setup. How would I scale this with docker-compose:
dcocker-compose scale app=3
app: | |
build: ./tile-server | |
restart: always | |
command: gunicorn wsgi:application -b 0.0.0.0:8080 -w 3 | |
ports: | |
- "8080" | |
nginx: | |
build: ./nginx | |
ports: | |
- 80:80 | |
links: | |
- app:app |
worker_processes 4; | |
events { | |
worker_connections 1024; | |
} | |
http { | |
upstream app_servers { | |
least_conn; | |
server app:8080 weight=10 max_fails=3 fail_timeout=30s; | |
server app:8080 weight=10 max_fails=3 fail_timeout=30s; | |
server app:8080 weight=10 max_fails=3 fail_timeout=30s; | |
} | |
server { | |
listen 80; | |
location / { | |
proxy_pass http://app_servers; | |
proxy_redirect off; | |
proxy_set_header Host $host; | |
proxy_set_header X-Real-IP $remote_addr; | |
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | |
proxy_set_header X-Forwarded-Host $server_name; | |
} | |
} | |
} |