Traefik Ghost

Traefik is a leading modern reverse proxy and load balancer that makes deploying microservices easy. Traefik integrates with your existing infrastructure components and configures itself automatically and dynamically.

Ghost is a free and open source blogging platform written in JavaScript and distributed under the MIT License, designed to simplify the process of online publishing for individual bloggers as well as online publications.

version: "3.8"

services:

  traefik:
    image: traefik:v2.5
    container_name: traefik
    command:
      - "--api.insecure=true"
      - "--providers.docker=true"
      - "--providers.docker.exposedbydefault=false"
      - "--entrypoints.web.address=:80"
      - "--entrypoints.web.http.redirections.entrypoint.to=websecure"
      - "--entrypoints.web.http.redirections.entrypoint.scheme=https"
      - "--entrypoints.websecure.address=:443"
      - "--certificatesresolvers.le.acme.httpchallenge=true"
      - "--certificatesresolvers.le.acme.httpchallenge.entrypoint=web"
      - "--certificatesresolvers.le.acme.email=username@gmail.com"
      - "--certificatesresolvers.le.acme.storage=/etc/traefik/acme.json"
    ports:
      - "80:80"
      - "443:443"
      - "8080:8080"
    volumes:
      - ./data:/etc/traefik
      - /var/run/docker.sock:/var/run/docker.sock:ro
    restart: unless-stopped
version: "3.8"

services:

  ghost:
    image: ghost:4-alpine
    container_name: ghost
    labels:
      - "traefik.enable=true"
      - "traefik.http.routers.ghost.rule=Host(`easypi.duckdns.org`, `blog.easypi.duckdns.org`)"
      - "traefik.http.routers.ghost.entrypoints=web,websecure"
      - "traefik.http.routers.ghost.tls.certresolver=le"
      - "traefik.http.routers.ghost.service=ghost"
      - "traefik.http.services.ghost.loadbalancer.server.port=2368"
    volumes:
      - ./data:/var/lib/ghost/content
    environment:
      - url=https://blog.easypi.duckdns.org
      - database__client=sqlite3
      - database__connection__filename=/var/lib/ghost/content/data/ghost.db
    restart: unless-stopped

networks:
  default:
    external: true
    name: traefik_default