alexcheng1982 / docker-magento2

Docker image for Magento Open Source 2
MIT License
381 stars 258 forks source link

After docker-compose up --build magento host want to re-install magento2. Is there any solution not to do this, because db already install? #58

Closed nos373737 closed 4 years ago

osmansafak commented 4 years ago

You must add volumes to the web service.

Edit the docker-compose.yml file as follows.

version: "3.0"
services:
  web:
    image: alexcheng/magento2
    ports:
      - "80:80"
    links:
      - db
    volumes:
      - web-file:/var/www
    env_file:
      - env
  db:
    image: mysql:5.7
    volumes:
      - db-data:/var/lib/mysql
    env_file:
      - env
  phpmyadmin:
    image: phpmyadmin/phpmyadmin
    ports:
      - "8580:80"
    links:
      - db
volumes:
  db-data:
  web-file: