-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
152 lines (144 loc) · 4.53 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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
version: "3.7"
services:
traefik:
image: traefik:v2.4.8
container_name: traefik
command:
- "--api.insecure=true"
- "--api.debug=true"
- "--log.level=debug"
- "--providers.docker"
- "--providers.docker.exposedbydefault=false"
- "--providers.docker.network=traefik-public"
- "--providers.file.filename=/configuration/certificates.toml"
- "--providers.file.watch=true"
- "--entrypoints.web.address=:80"
- "--entrypoints.websecure.address=:443"
ports:
- 80:80
- 443:443
- 8080:8080
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
- ./traefik/:/configuration
networks:
- traefik-public
labels:
- "traefik.enable=true"
- "traefik.http.routers.traefik.tls=true"
- "traefik.http.routers.traefik.rule=Host(`traefik.api.local`)"
- "traefik.http.routers.traefik.service=api@internal"
- "traefik.http.routers.http-catchall.rule=hostregexp(`{host:.+}`)"
- "traefik.http.routers.http-catchall.entrypoints=web"
- "traefik.http.routers.http-catchall.middlewares=redirect-to-https@docker"
- "traefik.http.middlewares.redirect-to-https.redirectscheme=https"
api:
build:
context: ./api
target: dev
container_name: api
environment:
CGO_ENABLED: 0
volumes:
- ./api:/api
ports:
- 4000:4000
networks:
- postgres-net
- traefik-public
depends_on:
- db
labels:
- "traefik.enable=true"
- "traefik.http.routers.api-http.rule=Host(`api.local`)"
- "traefik.http.routers.api-http.entrypoints=web"
- "traefik.http.routers.api-http.service=api-http-service"
- "traefik.http.services.api-http-service.loadbalancer.server.port=4000"
- "traefik.http.routers.api-https.rule=Host(`api.local`)"
- "traefik.http.routers.api-https.entrypoints=websecure"
- "traefik.http.routers.api-https.service=api-https-service"
- "traefik.http.services.api-https-service.loadbalancer.server.port=4000"
- "traefik.http.routers.api-https.tls=true"
command: sh -c 'go run main.go migrate up && CompileDaemon --build="go build -o grindlists ./main.go" --command="./grindlists serve"'
client:
build:
context: ./web
target: dev
container_name: client
ports:
- 3000:3000
volumes:
- ./web:/app
- /app/node_modules
networks:
- traefik-public
labels:
- "traefik.enable=true"
- "traefik.http.routers.client-http.rule=Host(`client.local`)"
- "traefik.http.routers.client-http.entrypoints=web"
- "traefik.http.routers.client-http.service=client-http-service"
- "traefik.http.services.client-http-service.loadbalancer.server.port=3000"
- "traefik.http.routers.client-https.tls=true"
- "traefik.http.routers.client-https.rule=Host(`client.local`)"
- "traefik.http.routers.client-https.entrypoints=websecure"
- "traefik.http.routers.client-https.service=client-https-service"
- "traefik.http.services.client-https-service.loadbalancer.server.port=3000"
debug-api:
build:
context: ./api
target: dev
container_name: debug_api
environment:
CGO_ENABLED: 0
volumes:
- ./api:/api
ports:
- 2345:2345
depends_on:
- db
networks:
- postgres-net
- traefik-public
labels:
- "traefik.enable=true"
- "traefik.http.routers.api.tls=true"
- "traefik.http.routers.api.rule=Host(`api.local`)"
- "traefik.http.routers.api.entrypoints=websecure"
- "traefik.http.services.api.loadbalancer.server.port=4000"
security_opt:
- "seccomp:unconfined"
tty: true
stdin_open: true
command: dlv debug --accept-multiclient --continue --headless --listen=:2345 --api-version=2 --log ./main.go -- serve
db:
image: postgres:11.12
container_name: devmarks-db
secrets:
- postgres_db
- postgres_user
- postgres_passwd
environment:
POSTGRES_DB_FILE: /run/secrets/postgres_db
POSTGRES_USER_FILE: /run/secrets/postgres_user
POSTGRES_PASSWORD_FILE: /run/secrets/postgres_passwd
ports:
- 5432:5432
volumes:
- postgres-devmarks-db:/var/lib/postgresql/data
networks:
- postgres-net
volumes:
postgres-devmarks-db:
external: true
networks:
postgres-net:
external: true
traefik-public:
external: true
secrets:
postgres_db:
file: ./secrets/postgres_db
postgres_passwd:
file: ./secrets/postgres_passwd
postgres_user:
file: ./secrets/postgres_user