Advertisement
PhoenyxRLP

wordpress docker

Feb 28th, 2023
905
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
YAML 1.75 KB | Source Code | 0 0
  1. version: '3.1'
  2.  
  3. volumes:
  4.   mysql_data:
  5. networks:
  6.   proxy:
  7.     external: true
  8.   backend:
  9.     external: true
  10.  
  11. services:
  12.   wordpress:
  13.     image: wordpress
  14.     container_name: wp_******
  15.     depends_on:
  16.      - dbwordpress
  17.     restart: unless-stopped
  18.     environment:
  19.       WORDPRESS_DB_HOST: ${WP_DB_HOST}
  20.       WORDPRESS_DB_USER: ${WP_DB_USER}
  21.       WORDPRESS_DB_PASSWORD: ${WP_DB_PW}
  22.       WORDPRESS_DB_NAME: ${WP_DB_NAME}
  23.     volumes:
  24.      - ./app:/var/www/html
  25.       - ./wordpress.ini:/usr/local/etc/php/conf.d/wordpress.ini
  26.     labels:
  27.      - "traefik.enable=true"
  28.       - "traefik.http.routers.wordpress.entrypoints=https"
  29.       - "traefik.http.routers.wordpress.rule=Host(`domain.tld`,`www.domain.tld`)"
  30.       - "traefik.http.routers.wordpress.middlewares=default@file"
  31.       - "traefik.http.routers.wordpress.tls=true"
  32.       - "traefik.http.routers.wordpress.tls.certresolver=http"
  33.       - "traefik.http.routers.wordpress.service=wordpress"
  34.       - "traefik.http.services.wordpress.loadbalancer.server.port=80"
  35.       - "traefik.docker.network=proxy"
  36.  
  37.     networks:
  38.       proxy:
  39.         ipv4_address: 172.18.0.6
  40.         ipv6_address: 2***::6
  41.       backend:
  42.         ipv4_address: 172.30.0.2
  43.  
  44.   dbwordpress:
  45.     image: mariadb
  46.     restart: unless-stopped
  47.     environment:
  48.       MARIADB_ROOT_PASSWORD: ${DB_ROOT_PW}
  49.       MARIADB_DATABASE: ${WP_DB_NAME}
  50.       MARIADB_USER: ${WP_DB_USER}
  51.       MARIADB_PASSWORD: ${WP_DB_PW}
  52.     volumes:
  53.      - ./database:/var/lib/mysql
  54.     networks:
  55.       backend:
  56.         ipv4_address: 172.30.0.3
  57.     ports:
  58.      - 3308:3306
  59.  
  60.   wpredis:
  61.     image: redis:alpine
  62.     container_name: wordpress-redis
  63.     restart: unless-stopped
  64.     networks:
  65.       backend:
  66.         ipv4_address: 172.30.0.10
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement