Skip to content

Instantly share code, notes, and snippets.

@milafrerichs
Last active August 29, 2015 14:20
Show Gist options
  • Save milafrerichs/5a35badd81b0df65da9a to your computer and use it in GitHub Desktop.
Save milafrerichs/5a35badd81b0df65da9a to your computer and use it in GitHub Desktop.
Docker setup

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;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment