Skip to content

Instantly share code, notes, and snippets.

@vdparikh
Created May 11, 2018 18:31
Show Gist options
  • Save vdparikh/01694d20b6568ef91acf260966ac875b to your computer and use it in GitHub Desktop.
Save vdparikh/01694d20b6568ef91acf260966ac875b to your computer and use it in GitHub Desktop.
Docker Compose with Go App, Postgres, Redis and MQ
version: '2'
services:
db:
image: postgres
environment:
GET_HOSTS_FROM: dns
POSTGRES_DB: dev
POSTGRES_USER: postgres-dev
POSTGRES_PASSWORD: password
ports:
- 5432:5432
redis:
image: redis:latest
volumes:
- /var/run/docker.sock:/var/run/docker.sock
ports:
- 6379:6379
actionmq:
image: rmohr/activemq
ports:
- 5672:5672
- 15672:15672
- 8161:8161
- 61616:61616
- 61613:61613
app:
build: .
command: ["go", "run", "main.go"]
privileged: true
environment:
GET_HOSTS_FROM: dns
POSTGRES_DB: dev
POSTGRES_USER: postgres-dev
POSTGRES_PASSWORD: password
GIN_MODE: release
volumes:
- /var/run/docker.sock:/var/run/docker.sock
# - /usr/bin/docker:/bin/docker
- /usr/local/bin/docker:/bin/docker
- .:/go/src/app/
ports:
- "443:443"
depends_on:
- db
- actionmq
- redis
links:
- db
- actionmq
- redis
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment