0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

Docker + Wordpress

Last updated at Posted at 2023-07-30
Dockerfile

    version: "3.9"
    
    services:
      wordpress:
        image: wordpress
        container_name: wordpress
        restart: always
        ports:
          - 8080:80
        networks:
          - wordpress
        volumes:
          - wordpress-data:/var/www/html
          - ./wordpress-data:/var/www/html
        depends_on:
          - mysqldb
    
      mysqldb:
        image: mysql
        container_name: mysql_db
        restart: always
        environment:
          MYSQL_ROOT_PASSWORD: password
          MYSQL_DATABASE: wordpress
          MYSQL_USER: user
          MYSQL_PASSWORD: password
        ports:
          - 3306:3306
        volumes:
          - mysql-data:/var/lib/mysql
          - ./mysql-data:/var/lib/mysql
        networks:
          - wordpress
    
      phpmyadmin:
        image: phpmyadmin
        container_name: admin
        restart: always
        ports:
          - 80:80
        networks:
          - wordpress
        environment:
          - PMA_HOST=mysqldb
          - PMA_USER=root
          - PMA_PASSWORD=password
        depends_on:
          - mysqldb
    
    networks:
      wordpress:
    
    volumes:
      wordpress-data:
      mysql-data:
Dockerfile

    version: "3.9"
    
    services:
      db:
        image: mysql:latest
        container_name: mysql-db
        restart: always
        environment:
          MYSQL_ROOT_PASSWORD: password
          MYSQL_DATABASE: initialdatabase
          MYSQL_USER: user
          MYSQL_PASSWORD: password
        ports:
          - "3306:3306"
        volumes:
          - mysql-data:/var/lib/mysql
          - ./data:/var/lib/mysql
          - ./initdb.d:/docker-entrypoint-initdb.d
        networks:
          - node-mysql
      app:
        container_name: node-app
        build: ./app
        restart: always
        ports:
          - "3000:3000"
        volumes:
          - ./app:/usr/src/app/
        networks:
          - node-mysql
        depends_on:
          - db
      phpmyadmin:
        container_name: admin
        image: phpmyadmin:latest
        ports:
          - "80:80"
        networks:
          - node-mysql
        depends_on:
          - db
      wordpress:
        container_name: wordpress
        image: wordpress:latest
        restart: always
        ports:
          - "8080:80"
        networks:
          - node-mysql
        depends_on:
          - db
        volumes:
          - wordpress-data:/var/www/html
          - ./wordpressData:/var/www/html
          - ./wordpress/php.ini:/usr/local/etc/php/conf.d/php.ini
        
        
        
    
    networks:
      node-mysql:
    
    
    volumes:
      wordpress-data:
      mysql-data:

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?