-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdocker-compose.yml.example
41 lines (39 loc) · 1.19 KB
/
docker-compose.yml.example
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
version: '3.8'
services:
app:
build:
context: .
dockerfile: Dockerfile
image: go_webapp
container_name: app
ports:
- 80:80
restart: unless-stopped
depends_on:
- traefik
labels:
- "traefik.enable=true"
- "traefik.http.routers.app.rule=Host(`foo.xyz`)"
- "traefik.http.routers.app.entrypoints=websecure"
- "traefik.http.routers.app.tls.certresolver=myresolver"
traefik:
image: "traefik:latest"
container_name: "traefik"
command:
- "--api.insecure=true"
- "--providers.docker=true"
- "--providers.docker.exposedbydefault=false"
- "--entrypoints.web.address=:80"
- "--entrypoints.websecure.address=:443"
- "--certificatesresolvers.myresolver.acme.dnschallenge=true"
- "--certificatesresolvers.myresolver.acme.dnschallenge.provider={dns provier}"
- "--certificatesresolvers.myresolver.acme.email={foo.email}"
- "--certificatesresolvers.myresolver.acme.storage=/letsencrypt/acme.json"
ports:
- "443:443"
- "8080:8080"
environment:
- "{value}={key}"
volumes:
- "./letsencrypt:/letsencrypt"
- "/var/run/docker.sock:/var/run/docker.sock:ro"