Skip to main content

Wordpress

version: '3'

services:
  db:
    image: mariadb:latest
    volumes:
      - db_data:/var/lib/mysql
    restart: unless-stopped
    environment:
      MARIADB_ROOT_PASSWORD: tbeFo80uVrGN9lsA
      MARIADB_DATABASE: wordpress
      MARIADB_USER: wordpress
      MARIADB_PASSWORD: 6y9SeZr9MnJmWW7N

  wordpress:
    image: wordpress:latest
    volumes:
      - wordpress:/var/www/html
    ports:
     - "8000:80"
    restart: unless-stopped
    environment:
      WORDPRESS_DB_HOST: db:3306
      WORDPRESS_DB_USER: wordpress
      WORDPRESS_DB_PASSWORD: 6y9SeZr9MnJmWW7N
      WORDPRESS_DB_NAME: wordpress
    depends_on:
      - db

volumes:
    db_data:
    wordpress:
Avec Traefik
version: '3'

services:
  db:
    image: mariadb:latest
    volumes:
      - db_data:/var/lib/mysql
    restart: unless-stopped
    networks:
      - traefik
    environment:
      MARIADB_ROOT_PASSWORD: tbeFo80uVrGN9lsA
      MARIADB_DATABASE: wordpress
      MARIADB_USER: wordpress
      MARIADB_PASSWORD: 6y9SeZr9MnJmWW7N

   wordpress:
    image: wordpress:latest
    container_name: wordpress
    volumes:
      - wordpress:/var/www/html
    networks:
        - traefik
    restart: unless-stopped
    environment:
      WORDPRESS_DB_HOST: db:3306
      WORDPRESS_DB_USER: wordpress
      WORDPRESS_DB_PASSWORD: 6y9SeZr9MnJmWW7N
      WORDPRESS_DB_NAME: wordpress
    labels:
        - "traefik.enable=true"
        - "traefik.http.routers.wordpress.rule=Host(`ndd.fr`)"
        - "traefik.http.routers.wordpress.entrypoints=web"
    depends_on:
      - db

volumes:
    db_data:
    wordpress:

networks:
  traefik:
    external: true