DEV Community

Cover image for Docker Compose - wordpress and docker [EN]
Alexandre Fernandes dos Santos
Alexandre Fernandes dos Santos

Posted on • Updated on

Docker Compose - wordpress and docker [EN]

I came here to share while listening to my "sertanejo" a script for docker-compose that creates a container with Wordpress and MariaDb as a database for a project i'm doing on twitch which is to create some themes so that's it i hope it helps someone else and any question just comment and i will be happy to answer ✌️

version: '3'

services:
  wordpress:
    image: wordpress
    restart: always
    ports:
      - 8080:80
    environment:
      WORDPRESS_DB_HOST: db
      WORDPRESS_DB_USER: user
      WORDPRESS_DB_PASSWORD: pass
      WORDPRESS_DB_NAME: wordpress
    volumes:
      - wordpress:/var/www/html
    depends_on:
      - db

  db:
    image: mariadb:latest
    restart: always
    environment:
      MYSQL_DATABASE: wordpress
      MYSQL_USER: user
      MYSQL_PASSWORD: pass
      MYSQL_RANDOM_ROOT_PASSWORD: '1'
    volumes:
      - db:/var/lib/mysql

volumes:
  wordpress:
  db:
Enter fullscreen mode Exit fullscreen mode

Top comments (1)

Collapse
 
wmramadan profile image
Wael Ramadan

Nice article, this might be worth a look github.com/WMRamadan/docker-compos...