Skip to content

Instantly share code, notes, and snippets.

@ddadlani
Last active February 7, 2019 20:56
Show Gist options
  • Save ddadlani/6ac546cec8946f0ea3ea31509267d621 to your computer and use it in GitHub Desktop.
Save ddadlani/6ac546cec8946f0ea3ea31509267d621 to your computer and use it in GitHub Desktop.
nginx config for two ATCs with docker-compose
version: '3'
services:
db:
image: postgres
ports:
- 6543:5432
environment:
POSTGRES_DB: concourse
POSTGRES_USER: dev
POSTGRES_PASSWORD: dev
web1:
build:
context: .
dockerfile: ${DOCKERFILE}
image: concourse/concourse:local
volumes:
- .:/src
command: web
depends_on: [db]
ports:
- 8081:8080
environment:
CONCOURSE_POSTGRES_HOST: db
CONCOURSE_POSTGRES_USER: dev
CONCOURSE_POSTGRES_PASSWORD: dev
CONCOURSE_POSTGRES_DATABASE: concourse
CONCOURSE_EXTERNAL_URL: http://localhost:8080
CONCOURSE_ADD_LOCAL_USER: test:test,guest:guest
CONCOURSE_MAIN_TEAM_LOCAL_USER: test
CONCOURSE_LOG_LEVEL: debug
web2:
build:
context: .
dockerfile: ${DOCKERFILE}
image: concourse/concourse:local
volumes:
- .:/src
command: web
depends_on: [db]
ports:
- 8082:8080
environment:
CONCOURSE_POSTGRES_HOST: db
CONCOURSE_POSTGRES_USER: dev
CONCOURSE_POSTGRES_PASSWORD: dev
CONCOURSE_POSTGRES_DATABASE: concourse
CONCOURSE_EXTERNAL_URL: http://localhost:8080
CONCOURSE_ADD_LOCAL_USER: test:test,guest:guest
CONCOURSE_MAIN_TEAM_LOCAL_USER: test
CONCOURSE_LOG_LEVEL: debug
lb:
image: nginx:latest
volumes:
- /tmp/n:/etc/nginx/nginx.conf
depends_on: [web1, web2]
ports:
- 8080:8080
worker:
build:
context: .
dockerfile: ${DOCKERFILE}
image: concourse/concourse:local
command: worker
privileged: true
depends_on: [web1, web2]
ports:
- 7777:7777
- 7788:7788
environment:
CONCOURSE_LOG_LEVEL: debug
CONCOURSE_TSA_HOST: web1:2222,web2:2222
CONCOURSE_EPHEMERAL: ${CONCOURSE_EPHEMERAL:-true}
# avoid using loopbacks
CONCOURSE_BAGGAGECLAIM_DRIVER: overlay
# so we can reach Garden/Baggageclaim for debugging
CONCOURSE_BIND_IP: 0.0.0.0
CONCOURSE_BAGGAGECLAIM_BIND_IP: 0.0.0.0
events { }
http {
upstream localhost {
server web1:8080;
server web2:8080;
}
server {
listen 8080;
server_name localhost;
location / {
proxy_pass http://localhost;
proxy_set_header Host $host;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment