This repository has been archived by the owner on Jan 6, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdocker-compose.yml
90 lines (84 loc) · 2.67 KB
/
docker-compose.yml
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
version: "3.8"
services:
traefik:
image: "traefik:v2.6"
restart: unless-stopped
container_name: "papo_traefik"
command:
#- "--log.level=DEBUG"
- "--api.insecure=true"
- "--providers.docker=true"
- "--providers.docker.exposedbydefault=false"
- "--entrypoints.web.address=:80"
- "--entrypoints.websecure.address=:443"
- "--certificatesresolvers.le.acme.httpchallenge=true"
- "--certificatesresolvers.le.acme.httpchallenge.entrypoint=web"
- "--certificatesresolvers.le.acme.caserver=https://acme-staging-v02.api.letsencrypt.org/directory"
- "--certificatesresolvers.le.acme.storage=/letsencrypt/acme.json"
ports:
- "80:80"
- "443:443"
# The Web UI (enabled by --api.insecure=true)
- "8080:8080"
volumes:
- "/var/run/docker.sock:/var/run/docker.sock:ro"
- "../data/letsencrypt:/letsencrypt"
db:
image: "mariadb:10"
container_name: "papo_db"
restart: unless-stopped
ports:
- "3306:3306"
volumes:
- ../data/db:/var/lib/mysql
labels:
- "traefik.enable=false"
environment:
MARIADB_ROOT_PASSWORD_FILE: /run/secrets/db_root_password
MARIADB_DATABASE: oypoints
MARIADB_USER: papo_oypoints
MARIADB_PASSWORD_FILE: /run/secrets/db_papo_oypoints_password
secrets:
- db_root_password
- db_papo_oypoints_password
api:
image: papo/api
container_name: "papo_api"
restart: unless-stopped
build:
context: api
dockerfile: Dockerfile
depends_on:
- db
labels:
- "traefik.enable=true"
- "traefik.http.routers.api.entrypoints=websecure"
- "traefik.http.routers.api.rule=Host(`oypoints.papo.org.nz`) && PathPrefix(`/api/`)"
- "traefik.http.services.api.loadbalancer.server.port=9000"
- "traefik.http.routers.api.tls.certresolver=le"
environment:
MYSQL_HOST: db
MYSQL_USER: papo_oypoints
MYSQL_PASSWORD: /run/secrets/db_papo_oypoints_password
secrets:
- db_papo_oypoints_password
client:
image: papo/client
container_name: "papo_client"
restart: unless-stopped
build:
context: client
dockerfile: Dockerfile
depends_on:
- api
labels:
- "traefik.enable=true"
- "traefik.http.routers.client.entrypoints=websecure"
- "traefik.http.routers.client.rule=Host(`oypoints.papo.org.nz`) && PathPrefix(`/`)"
- "traefik.http.routers.client.tls.certresolver=le"
secrets:
db_root_password:
file: ../secrets/db_root_password.txt
db_papo_oypoints_password:
file: ../secrets/db_papo_oypoints_password.txt