biggt

Docker-Compose.yaml (Wordpress Stack)

Aug 21st, 2020
626
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
YAML 1.58 KB | None | 0 0
  1. ### <mywebsite>.com
  2. version: '3.1'
  3. services:
  4.   <mywebsite>-site:
  5.     image: wordpress:5.5.0-php7.4
  6.     #image: wordpress:latest
  7.     container_name: <mywebsite>-site
  8.     restart: unless-stopped
  9.     ports:
  10.      - 80
  11.     environment:
  12.      - WORDPRESS_DB_HOST=<mywebsite>-db
  13.       - WORDPRESS_DB_USER=<DB_USER>
  14.      - WORDPRESS_DB_PASSWORD=<DB_PW>
  15.      - WORDPRESS_DB_NAME=<mywebsite>
  16.      
  17.       - VIRTUAL_HOST=<mywebsite>.com,www.<mywebsite>.com
  18.       - VIRTUAL_PORT=80
  19.       - LETSENCRYPT_HOST=<mywebsite>.com,www.<mywebsite>.com
  20.       - LETSENCRYPT_EMAIL=<LE_EMAIL>
  21.      - HTTPS_METHOD=noredirect
  22.     depends_on:
  23.       - <mywebsite>-db
  24.       - <mywebsite>-cache
  25.     volumes:
  26.      - /var/www/html/<mywebsite>.com:/var/www/html
  27.       - ./usr/local/etc/php/conf.d:/usr/local/etc/php/conf.d
  28.       - /var/logs/<mywebsite>.com:/var/logs/
  29.  
  30.  
  31.   <mywebsite>-db:
  32.     image: mysql:5.7
  33.     container_name: <mywebsite>-db
  34.     restart: unless-stopped
  35.     environment:
  36.      - MYSQL_DATABASE=<mywebsite>
  37.      - MYSQL_USER=<DB_USER>
  38.      - MYSQL_PASSWORD=<DB_PW>
  39.      - MYSQL_ROOT_PASSWORD=biggt92
  40.     volumes:
  41.      - ./<mywebsite>-db/var/lib/mysql:/var/lib/mysql
  42.    
  43.  
  44.   <mywebsite>-cache:
  45.     image: redis:latest
  46.     hostname: <mywebsite>-cache
  47.     container_name: <mywebsite>-cache
  48.     command: redis-server /etc/redis/redis.conf
  49.     volumes:
  50.      - /etc/localtime:/etc/localtime:ro
  51.       - ./redis.conf:/etc/redis/redis.conf
  52.     restart: always
  53.  
  54.  
  55.  
  56. volumes:
  57.   <mywebsite>-db:
  58.   <mywebsite>-site:
  59.  
  60. networks:
  61.   default:
  62.     external:
  63.       name: nginx-proxy
  64.  
Add Comment
Please, Sign In to add comment