Skip to content

Instantly share code, notes, and snippets.

@mrtuvn
Created February 17, 2019 16:02
Show Gist options
  • Save mrtuvn/511543b23a9774f9dcf76b83e3deb7ee to your computer and use it in GitHub Desktop.
Save mrtuvn/511543b23a9774f9dcf76b83e3deb7ee to your computer and use it in GitHub Desktop.
customize docker compose for magento 2
version: "3"
services:
cron:
image: fballiano/magento2-cron
depends_on:
- apache
- varnish
links:
- db
- cache
- clusterdata
- apache
- varnish
volumes:
- ./magento2:/var/www/html
- ./varnish.secret:/varnish.secret
# Enable the next line if you want to add a custom php.ini
- ./php.ini:/usr/local/etc/php/conf.d/999-customphp.ini
ssl:
image: fballiano/nginx-ssl-for-magento2
depends_on:
- varnish
links:
- varnish
ports:
- "443:443"
volumes:
- ./ssl/default-fake.crt:/etc/nginx/ssl/default-fake.crt
- ./ssl/default-fake.key:/etc/nginx/ssl/default-fake.key
- ./nginx-default.conf:/etc/nginx/conf.d/nginx-default.conf
- ./nginx.conf.sample:/etc/nginx/conf.d/nginx.conf.sample
varnish:
image: fballiano/varnish
ports:
- "80:80"
- "6082:6082"
depends_on:
- apache
links:
- apache
volumes:
- ./varnish.vcl:/etc/varnish/default.vcl
- ./varnish.secret:/etc/varnish/secret
environment:
- CACHE_SIZE=256M
apache:
image: fballiano/magento2-apache-php
depends_on:
- db
- cache
- clusterdata
links:
- db
- cache
- clusterdata
volumes:
- ./magento2:/var/www/html
- ~/.composer/auth.json:/root/.composer/auth.json
# Enable the next line if you want to add a custom php.ini
- ./php.ini:/usr/local/etc/php/conf.d/999-customphp.ini
db:
image: mariadb
ports:
- "3306:3306"
volumes:
- dbdata:/var/lib/mysql
environment:
- MYSQL_ROOT_PASSWORD=magento2
- MYSQL_DATABASE=magento2
- MYSQL_USER=magento2
- MYSQL_PASSWORD=magento2
cache:
image: fballiano/redis-volatile
clusterdata:
image: fballiano/redis-volatile
volumes:
dbdata:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment