DEV Community

loading...
Cover image for Docker-compose tip - wordpress and docker [EN]

Docker-compose tip - wordpress and docker [EN]

Alexandre Fernandes dos Santos
Um apaixonado em transformar tecnologia em algo que mude e facilite a vida das pessoas
Updated on ・1 min read

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

Discussion (0)

Forem Open with the Forem app