Skip to content

Commit

Permalink
Merge pull request mbentley#3 from mbentley/demo-updates
Browse files Browse the repository at this point in the history
Demo updates to work with new v2 compose format
  • Loading branch information
Matt Bentley committed Mar 17, 2016
2 parents 0dcdbce + 4bfd6c9 commit 64dd7ee
Show file tree
Hide file tree
Showing 20 changed files with 115 additions and 23 deletions.
File renamed without changes.
File renamed without changes.
File renamed without changes.
48 changes: 48 additions & 0 deletions docker-compose-deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
version: "2"

services:
app:
image: ${DTR_URL}/demo/docker-demo:${TAG}
restart: always
entrypoint: /bin/bash
command: -c "sleep 5 && go-wrapper run" # sleep because the postgres container isn't ready on first start
environment:
- "constraint:node!=*-master"
- "constraint:provider==${PROVIDER}"
- "TITLE=Docker Demo-${ENVIRONMENT}"
- "DB_USER=${DB_USER}"
- "DB_PASS=${DB_PASS}"
- "DB_NAME=${DB_NAME}"
- "DB_SSL_MODE=disable"
- "DB_PORT_5432_TCP_ADDR=db"
- "DB_PORT_5432_TCP_PORT=5432"
- "INTERLOCK_DATA={\"hostname\":\"docker-${ENVIRONMENT}\",\"domain\":\"${DOMAIN_NAME}\"}"
networks:
- docker-demo
ports:
- "8080"
expose:
- "8080"
db:
image: postgres:latest
restart: always
environment:
- "constraint:node==*master"
- "POSTGRES_USER=${DB_USER}"
- "POSTGRES_PASSWORD=${DB_PASS}"
volumes:
- postgres-data:/var/lib/postgresql/data
networks:
- docker-demo
expose:
- "5432"
ports:
- "${POSTGRES_PORT}:5432"

volumes:
postgres-data:
driver: local

networks:
docker-demo:
driver: overlay
34 changes: 34 additions & 0 deletions docker-compose-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
version: "2"

services:
app:
image: ${DTR_URL}/demo/docker-demo:${TAG}
entrypoint: /bin/bash
command: -c "sleep 5 && go-wrapper run" # sleep because the postgres container isn't ready on first start
environment:
- "TITLE=${TITLE}"
- "DB_USER=${DB_USER}"
- "DB_PASS=${DB_PASS}"
- "DB_NAME=${DB_NAME}"
- "DB_SSL_MODE=disable"
links:
- "db:db"
network_mode: "bridge"
ports:
- "8080"
expose:
- "8080"
db:
image: postgres:latest
environment:
- "POSTGRES_USER=${DB_USER}"
- "POSTGRES_PASSWORD=${DB_PASS}"
volumes:
- postgres-data:/var/lib/postgresql/data
network_mode: "bridge"
expose:
- "5432"

volumes:
postgres-data:
driver: local
56 changes: 33 additions & 23 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,24 +1,34 @@
app:
build: demo_pq
entrypoint: /bin/bash
command: -c "sleep 5 && go-wrapper run" # sleep because the postgres container isn't ready on first start
environment:
- "TITLE=Docker Demo"
- "DB_USER=demo"
- "DB_PASS=demo"
- "DB_NAME=demo"
- "DB_SSL_MODE=disable"
links:
- "db:db"
ports:
- 8080:8080
expose:
- 8080
version: "2"

db:
image: postgres:latest
environment:
- "POSTGRES_USER=demo"
- "POSTGRES_PASSWORD=demo"
expose:
- 5432
services:
app:
build: .
entrypoint: /bin/bash
command: -c "sleep 5 && go-wrapper run" # sleep because the postgres container isn't ready on first start
environment:
- "TITLE=Docker Demo"
- "DB_USER=demo"
- "DB_PASS=demo"
- "DB_NAME=demo"
- "DB_SSL_MODE=disable"
links:
- "db:db"
network_mode: "bridge"
ports:
- "8080:8080"
expose:
- "8080"
db:
image: postgres:latest
environment:
- "POSTGRES_USER=demo"
- "POSTGRES_PASSWORD=demo"
volumes:
- postgres-data:/var/lib/postgresql/data
network_mode: "bridge"
expose:
- "5432"

volumes:
postgres-data:
driver: local
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes.

0 comments on commit 64dd7ee

Please sign in to comment.