Last active
August 29, 2015 14:27
-
-
Save blackjid/7da73b1dacc58255a600 to your computer and use it in GitHub Desktop.
Hound with Docker and Rancher
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
app: | |
ports: | |
- 3000/tcp | |
environment: | |
CHANGED_FILES_THRESHOLD: '300' | |
ENABLE_HTTPS: 'no' | |
EXEMPT_ORGS: platanus | |
GITHUB_CLIENT_ID: <GITHUB_CLIENT_ID> | |
GITHUB_CLIENT_SECRET: <GITHUB_CLIENT_SECRET> | |
HOST: monkeyci.platan.us | |
HOUND_GITHUB_TOKEN: <HOUND_GITHUB_TOKEN> | |
HOUND_GITHUB_USERNAME: monkeyci | |
MAX_COMMENTS: '10' | |
POSTGRES_ENV_POSTGRES_PASSWORD: <POSTGRES_ENV_POSTGRES_PASSWORD> | |
POSTGRES_ENV_POSTGRES_USER: hound | |
POSTGRES_PORT_5432_TCP_ADDR: db | |
POSTGRES_PORT_5432_TCP_PORT: '5432' | |
QUEUE: high,medium,low | |
RAILS_ENV: production | |
REDIS_PORT_6379_TCP_ADDR: redis | |
REDIS_PORT_6379_TCP_PORT: '6379' | |
RESQUE_ADMIN_PASSWORD: password | |
RESQUE_JOB_TIMEOUT: '120' | |
SECRET_KEY_BASE: <SECRET_KEY_BASE> | |
SPLIT_ADMIN_PASSWORD: <SPLIT_ADMIN_PASSWORD> | |
labels: | |
io.rancher.sidekicks: web | |
command: | |
- bundle | |
- exec | |
- unicorn | |
- -p | |
- '3000' | |
- -c | |
- ./config/unicorn.rb | |
entrypoint: | |
- /usr/src/app/config/docker/rails-entrypoint.sh | |
image: platanus/hound | |
links: | |
- redis:redis | |
- db:db | |
volumes: | |
- /usr/src/app | |
db: | |
environment: | |
POSTGRES_PASSWORD: <POSTGRES_PASSWORD> | |
POSTGRES_USER: hound | |
image: postgres | |
redis: | |
image: redis | |
web: | |
ports: | |
- 80/tcp | |
entrypoint: | |
- /usr/src/app/config/docker/nginx-entrypoint.sh | |
image: nginx | |
links: | |
- redis:redis | |
- db:db | |
volumes_from: | |
- app | |
lb: | |
ports: | |
- 80:80 | |
restart: always | |
labels: | |
io.rancher.loadbalancer.target.app: monkeyci.platan.us:80=80 | |
tty: true | |
image: rancher/load-balancer-service | |
links: | |
- app:app | |
stdin_open: true | |
resque: | |
environment: | |
CHANGED_FILES_THRESHOLD: '300' | |
ENABLE_HTTPS: 'no' | |
EXEMPT_ORGS: platanus | |
GITHUB_CLIENT_ID: <GITHUB_CLIENT_ID> | |
GITHUB_CLIENT_SECRET: <GITHUB_CLIENT_SECRET> | |
HOST: monkeyci.platan.us | |
HOUND_GITHUB_TOKEN: <HOUND_GITHUB_TOKEN> | |
HOUND_GITHUB_USERNAME: monkeyci | |
MAX_COMMENTS: '10' | |
POSTGRES_ENV_POSTGRES_PASSWORD: <POSTGRES_ENV_POSTGRES_PASSWORD> | |
POSTGRES_ENV_POSTGRES_USER: hound | |
POSTGRES_PORT_5432_TCP_ADDR: db | |
POSTGRES_PORT_5432_TCP_PORT: '5432' | |
QUEUE: high,medium,low | |
RAILS_ENV: production | |
REDIS_PORT_6379_TCP_ADDR: redis | |
REDIS_PORT_6379_TCP_PORT: '6379' | |
RESQUE_ADMIN_PASSWORD: password | |
RESQUE_JOB_TIMEOUT: '120' | |
SECRET_KEY_BASE: <SECRET_KEY_BASE> | |
SPLIT_ADMIN_PASSWORD: <SPLIT_ADMIN_PASSWORD> | |
command: | |
- bundle | |
- exec | |
- rake | |
- resque:work | |
image: platanus/hound | |
links: | |
- redis:redis | |
- db:db | |
volumes: | |
- /usr/src/app |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
upstream hound-app-server { | |
server app:3000 fail_timeout=0; | |
} | |
server { | |
root /usr/src/app/public; | |
location ^~ /assets/ { | |
gzip_static on; | |
expires max; | |
add_header Cache-Control public; | |
} | |
try_files $uri/index.html $uri @hound-app-server; | |
location @hound-app-server { | |
proxy_set_header X-Real-IP $remote_addr; | |
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | |
proxy_set_header X-FORWARDED_PROTO http; | |
proxy_set_header Host $http_host; | |
proxy_redirect off; | |
proxy_pass http://hound-app-server; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@blackjid your lb service has some incorrect config. Its ports should be:
lb:
ports:
As 3000 is the port app listens on. So traffic will come to lb service on port 80, and then LB will redirect it to the app service listening on port 3000