summaryrefslogtreecommitdiffstats
path: root/docker-compose-acme.yml
blob: eafaa38c283f2c27931c761adb484b6e58c93123 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
# Provides reverse HTTP proxy service, including TLS termination and automated
# certificate management via Lets Encrypt.  To create a Docker container that
# uses this service:
#
#   - Define environment variables:
#         - VIRTUAL_HOST=<domain name>
#         - LETSENCRYPT_HOST=<domain name>
#         - VIRTUAL_PORT=<port number>  (only necessary if not 80)
#
#   - EXPOSE the relevant port in your Dockerfile.
#
#   - Join the "nginx-proxy-network" network.

version: "3.7"

services:
  # https://github.com/nginx-proxy/nginx-proxy
  nginx-proxy:
    image: "nginxproxy/nginx-proxy"
    restart: "always"
    volumes:
      - "certs:/etc/nginx/certs"
      - "vhost:/etc/nginx/vhost.d"
      - "html:/usr/share/nginx/html"
      - "/var/run/docker.sock:/tmp/docker.sock:ro"
    networks:
      - "nginx-proxy-network"
    ports:
      - "80:80"
      - "443:443"
    labels:
      - "com.github.nginx-proxy.nginx"

  # https://github.com/nginx-proxy/acme-companion
  acme-companion:
    image: "nginxproxy/acme-companion"
    restart: "always"
    volumes:
      - "acme:/etc/acme.sh"
      - "certs:/etc/nginx/certs"
      - "vhost:/etc/nginx/vhost.d"
      - "html:/usr/share/nginx/html"
      - "/var/run/docker.sock:/var/run/docker.sock:ro"
    networks:
      - "nginx-proxy-network"
    depends_on:
      - "nginx-proxy"

volumes:
  acme:
  certs:
  vhost:
  html:

networks:
  nginx-proxy-network:
    name: "nginx-proxy-network"