Skip to content

Instantly share code, notes, and snippets.

@kristinn
Forked from tomasfejfar/docker-compose.yml
Created May 17, 2022 14:32
Show Gist options
  • Save kristinn/de94b998150d5faf298e50e5b7188ad3 to your computer and use it in GitHub Desktop.
Save kristinn/de94b998150d5faf298e50e5b7188ad3 to your computer and use it in GitHub Desktop.
Using YAML to reuse parts of existing docker-compose configuration
version: "3"
services:
apache: &apacheConfig
build: .
volumes:
- ./:/var/www/html:cached
- ./docker/php-apache/php.ini:/usr/local/etc/php/php.ini
- ./docker/php-apache/ssl-local:/etc/httpd/ssl
working_dir: /var/www/html
ports:
- "8700:443"
- "8800:80"
links:
- elasticsearch
apache-xdebug:
<<: *apacheConfig
build: docker/xdebug
volumes:
- ./:/var/www/html:cached
- ./docker/php-apache/php.ini:/usr/local/etc/php/php.ini
- ./docker/php-apache/ssl-local:/etc/httpd/ssl
- ./docker/xdebug/xdebug.ini:/usr/local/etc/php/conf.d/xdebug.ini
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment