Full Stack LAMP - MEAN Developer, Python developer. Certified Azure Developer. Freelance programmer/consultant/trainer.

Windows Server – Docker Compose – Caddy Server Reverse Proxy

  1. Create a directory called caddyConfig.
  2. Create a directory called ssl under the caddyConfig directory. And place your SSL certificates into it.
  3. Create a file called Caddyfile under the caddyConfig directory. Add the below config to it and update the certificate path and filename according to yours.
  4. Update the domain name in the below config settings.
https://screenshot.arjunphp.com {
tls c:\etc\caddy\ssl\arjunphp.chained.pem c:\etc\caddy\ssl\arjunphp.com.pem
reverse_proxy screenshot_server:8000
}

docker-compose.yml

version: "3.8"
services:
  screenshot_server:
    image: arjunphp/screenshot_server
    restart: always
    hostname: screenshot_server
    expose: 
      - 8000
    networks:
      - app_net 

  proxy_server:
    image: caddy:2.5.1-windowsservercore-1809
    restart: always
    hostname: proxy
    networks:
      - app_net
    volumes:
      - ./caddy:C:/etc/caddy
    ports: 
      - "80:80"
      - "443:443"

networks: 
  app_net:
    driver: nat
    driver_opts: 
      com.docker.network.enable_ipv6: "false"
    ipam: 
      driver: default
      config: 
        - subnet: 172.16.238.0/24