Skip to content

Instantly share code, notes, and snippets.

@lu911
Created February 24, 2017 06:58
Show Gist options
  • Save lu911/264f949be26d3b69952bc42ff9e35b72 to your computer and use it in GitHub Desktop.
Save lu911/264f949be26d3b69952bc42ff9e35b72 to your computer and use it in GitHub Desktop.
ddingdon docker-compose
version: '2'
services:
postgres:
restart: always
image: postgres:9.4
hostname: postgres
container_name: pg
ports:
- "5432:5432"
volumes:
- '/opt/data/pg:/var/lib/postgresql/data'
environment:
- POSTGRES_USER=AAAA
- POSTGRES_PASSWORD=AAAA
- POSTGRES_DB=AAAA
redis:
restart: always
image: redis:3.2
hostname: redis
container_name: redis
command: redis-server --appendonly yes
ports:
- "6379:6379"
volumes:
- '/opt/data/redis:/data'
api:
restart: always
image: api:latest
container_name: api
env_file:
- ./envs/service.env
environment:
- APP_ENV=api
- VIRTUAL_HOST=api.localhost
- VIRTUAL_PROTO=uwsgi
depends_on:
- postgres
- redis
admin:
restart: always
image: admin:latest
container_name: admin
env_file:
- ./envs/service.env
environment:
- APP_ENV=admin
- VIRTUAL_HOST=admin.localhost
depends_on:
- postgres
- redis
nginx:
restart: always
image: jwilder/nginx-proxy
container_name: nginx
ports:
- "80:80"
volumes:
- /var/run/docker.sock:/tmp/docker.sock:ro
networks:
default:
external:
name: proxy-tier
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment