I want to create a docker image which has nginx, php7 (and required modules), mysql and magento2. Also, want to create docker-compose scripts.
Any help will be appreciated.
I want to create a docker image which has nginx, php7 (and required modules), mysql and magento2. Also, want to create docker-compose scripts.
Any help will be appreciated.
You can use https://github.com/mageinferno/magento2-docker-compose as a prototype and then improve it for your needs.
You can use this image from Docker Hub https://hub.docker.com/r/folio3ecommerce/magento-php-apache
There are available tags for 2.4.3-p1, 2.4.4-p2, 2.4.5
Sample docker-compose.yml file
version: '3'
services:
magento:
image: folio3ecommerce/magento-php-apache:2.4.5
restart: on-failure
ports:
- "${APP_PORT}:80"
env_file: env/phpfpm.env
links:
- db
- redis
- elasticsearch
depends_on:
- db
networks:
- customNetwork
db:
image: mariadb:10.4
restart: on-failure
command: --max_allowed_packet=256M
ports:
- "${DB_PORT}:3306"
env_file: env/db.env
volumes:
- dbdata:/var/lib/mysql
networks:
- customNetwork
redis:
image: redis:5.0-alpine
restart: on-failure
ports:
- "${REDIS_PORT}:6379"
networks:
- customNetwork
elasticsearch:
image: elasticsearch:7.16.2
restart: on-failure
ports:
- "${ES_PORT}:9200"
- "${ES_SSL_PORT}:9300"
volumes:
- elasticsearchdata:/var/lib/elasticsearch
environment:
- "discovery.type=single-node"
## Set custom heap size to avoid memory errors
- "ES_JAVA_OPTS=-Xms1g -Xmx1g"
## Avoid test failures due to small disks
## More info at https://github.com/markshust/docker-magento/issues/488
- "cluster.routing.allocation.disk.threshold_enabled=false"
- "index.blocks.read_only_allow_delete"
networks:
- customNetwork
volumes:
dbdata:
redisdata:
elasticsearchdata:
networks:
customNetwork:
Further instructions are already available on docker hub