-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
docker-compose-staging.yml
86 lines (79 loc) · 3 KB
/
docker-compose-staging.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
version: "3.8"
services:
db:
env_file:
- ./back/.env.staging
volumes:
# - ./data:/var/lib/postgresql/data
- /home/bbo/composite/postgres-data:/var/lib/postgresql/data
cache:
volumes:
- /home/bbo/composite/cache:/data
traefik:
container_name: composite_gateway
image: traefik:latest
command:
- "--providers.docker=true"
- "--providers.docker.exposedbydefault=false"
- "--entrypoints.websecure.address=:443"
- "--certificatesresolvers.myresolver.acme.tlschallenge=true"
- "--certificatesresolvers.myresolver.acme.email=boursbenjamin@gmail.com"
- "--certificatesresolvers.myresolver.acme.storage=/letsencrypt/acme.json"
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- /home/bbo/composite/letsencrypt:/letsencrypt
ports:
# The HTTP port
- "80:80"
# The HTTPS port
- "443:443"
api:
image: boursbenjamin/composite-back:0.4.0
env_file:
- ./back/.env.staging
labels:
- "traefik.http.routers.api.rule=Host(`staging.api.compositethegame.com`)"
- traefik.http.middlewares.api_middleware.headers.accesscontrolalloworiginlist=https://staging.compositethegame.com
- traefik.http.routers.api.entrypoints=websecure
- traefik.http.routers.api.tls.certresolver=myresolver
front:
image: boursbenjamin/composite-front:0.4.0
depends_on:
- db
env_file:
- ./front/.env.staging
labels:
- traefik.http.routers.front.rule=Host(`staging.compositethegame.com`)
- traefik.http.routers.front.entrypoints=websecure
- traefik.http.routers.front.tls.certresolver=myresolver
api_dev:
image: boursbenjamin/composite-back:0.4.0-next.1
networks:
- main
- database
env_file:
- ./back/.env.staging
labels:
- traefik.enable=true
- "traefik.http.routers.api_dev.rule=Host(`dev.api.compositethegame.com`)"
- traefik.docker.network=main
- traefik.http.services.api_dev.loadbalancer.server.port=3002
- traefik.http.services.api_dev.loadBalancer.sticky.cookie.name=server_id
- traefik.http.services.api_dev.loadBalancer.sticky.cookie.httpOnly=true
- traefik.http.middlewares.api_dev_middleware.headers.accesscontrolalloworiginlist=https://dev.compositethegame.com
- traefik.http.middlewares.api_dev_middleware.headers.accessControlAllowCredentials=true
- traefik.http.routers.api_dev.middlewares=api_dev_middleware
- traefik.http.routers.api_dev.entrypoints=websecure
- traefik.http.routers.api_dev.tls.certresolver=myresolver
front_dev:
image: boursbenjamin/composite-front:0.4.0-next.1
networks:
- main
env_file:
- ./front/.env.dev
labels:
- "traefik.enable=true"
- "traefik.http.routers.front_dev.rule=Host(`dev.compositethegame.com`)"
- traefik.http.services.front_dev.loadbalancer.server.port=3000
- traefik.http.routers.front_dev.entrypoints=websecure
- traefik.http.routers.front_dev.tls.certresolver=myresolver