This repo contains Magento docker build files for different versions of Magento
1. Clone repository
2. cd magento/<version>/dockerfiles
Find .env file open it with editor and replace all vars wrapped with {{var}} .
Example: DB_USER: {{DB_USER}} to DB_USER:magento
3. docker-compose up -d
Example docker-compose.yml file:
version: '2'
volumes:
mariadb_data:
driver: local
magento_data:
driver: local
services:
magento:
image: ${REGISTRY}trydirect:magento:2.3.2
container_name: magento
env_file:
.env
volumes:
- ./magento:/home/magento2
- /var/www
- magento_data:/data
- ./cron:/var/spool/cron/crontabs
depends_on:
- mariadb
working_dir: /var/www/magento2
mariadb:
image: "mariadb:latest"
container_name: magento_mariadb
env_file:
.env
volumes:
- "mariadb_data:/var/lib/mysql"
nginx:
image: ${REGISTRY}nginx-le:stable
container_name: nginx
env_file: .env
ports:
- "80:80"
- "443:443"
volumes:
- ./certs/ssl:/etc/ssl/nginx
- ./certs/letsencrypt:/etc/letsencrypt
- ./cron/nginx:/var/spool/cron/crontabs
- ./nginx/conf.d:/etc/nginx/conf.d/
- ./nginx/nginx.conf:/etc/nginx/nginx.conf
- ./null:/etc/nginx/sites-enabled
- ./supervisord/nginx.conf:/etc/supervisor/conf.d/nginx.conf
links:
- magento
entrypoint: /usr/bin/supervisord -c /etc/supervisor/supervisord.conf -n
Join https://gitter.im/try-direct/community for details on our code of conduct, and the process for submitting pull requests to us.
We use SemVer for versioning.
See the list of contributors who participated in this project.
This project is licensed under the MIT License - see the LICENSE.md file for details
Add
volumes:
- ./magento:/var/www/magento2
to magento service in case you have magento source code on your host machine and want to sync directories with container.