Skip to content

Instantly share code, notes, and snippets.

@dgmike
Created June 28, 2017 16:58
Show Gist options
  • Save dgmike/44337d2f40d3079d9a2423787d0085dc to your computer and use it in GitHub Desktop.
Save dgmike/44337d2f40d3079d9a2423787d0085dc to your computer and use it in GitHub Desktop.
Use docker-compose with extends
version: "2"
services:
app:
build:
context: .
dockerfile: Dockerfile.dev
volumes:
- ./src:/app
ports:
- 80:80
env_file: .env
networks: ['local-network']
command: npm run start:dev
database:
image: mysql:latest
volumes:
- ./data/mysql:/var/lib/mysql
networks: ['local-network']
environment:
MYSQL_DATABASE: ''
MYSQL_USER: ''
MYSQL_PASSWORD: ''
MYSQL_RANDOM_ROOT_PASSWORD: 1
networks:
local-network:
driver: bridge
version: '2'
services:
middleware:
networks: ['local-network']
extends:
file: middleware/docker-compose.yml
service: app
database:
networks: ['local-network']
extends:
file: corporate-groups-api__docker-compose.yml
service: database
corporate_groups:
networks: ['local-network']
extends:
file: corporate-groups-api__docker-compose.yml
service: app
networks:
local-network:
driver: bridge
version: "2"
services:
app:
build:
context: .
dockerfile: Dockerfile.dev
volumes:
- ./src:/app
ports:
- 443:443
env_file: .env
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment