2

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.

1
  • Are you able to manage this Image ? I want to create a same Image and I am beginner in docker so . Any hint for me ? how to create it from scratch ? @SK Commented Feb 9, 2017 at 10:54

2 Answers 2

1

You can use https://github.com/mageinferno/magento2-docker-compose as a prototype and then improve it for your needs.

1
  • I want to create a same Image and I am beginner in docker so . Any hint for me ? how to create it from scratch ? @KAndy Commented Feb 9, 2017 at 10:55
0

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.