WordPress

docker-compose.yml

version: '3'
services:

  httpd:
    image: registry.gitlab.com/cloudmonitor/images/caddy:latest
    restart: unless-stopped
    links:
      - app
    environment:
      - WEBROOT=/var/www/html
    networks:
      - app-network
      - web
    labels:
      - traefik.http.routers.{SERVICE}.rule=(Host(`{DOMAIN}`) || Host(`{DOMAIN_ALIAS}`))
      - traefik.http.routers.{SERVICE}.entrypoints=websecure
      - traefik.http.routers.{SERVICE}.tls=true
      - traefik.http.routers.{SERVICE}.tls.certresolver=leresolver
    volumes:
      - app-data:/var/www/html
      - {WP_CONTENT}:/var/www/html/wp-content

  smtp:
    image: registry.gitlab.com/cloudmonitor/images/smtp-relay:latest
    restart: unless-stopped
    env_file:
      - .env
    volumes:
      - ./opendkim:/etc/opendkim/keys/default
    networks:
      - app-network

  app:
    image: registry.gitlab.com/cloudmonitor/images/wordpress:latest
    restart: unless-stopped
    env_file:
      - .env
    volumes:
      - app-data:/var/www/html
      - {WP_CONTENT}:/var/www/html/wp-content
    networks:
      - app-network
      - mariadb_database

networks:
  app-network:
    driver: bridge
  web:
    external: true
  mariadb_database:
    :external: true

volumes:
  app-data:

.env

DB_NAME=
DB_USER=
DB_PASSWORD=
DB_HOST=
RELAY_HOST=
HOSTNAME=
Emil Moe

Software- and Data Engineer

I created this website to help you empower your infrastructure and so you don't need to spend the same amount of hours as me on researching. I chose to make the site ad-free, so if you like what I do, please consider supporting my Patreon.

Leave a Reply

Your email address will not be published. Required fields are marked *