-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
92 lines (86 loc) · 2.74 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
version: '3'
services:
traefik:
image: traefik:v3.0.0-beta2
container_name: traefik
command: --api.insecure=true --providers.docker --log.level=INFO
ports:
- "80:80"
- "8080:8080" # The Web UI (enabled by --api.insecure=true)
volumes:
- /var/run/docker.sock:/var/run/docker.sock
nats:
image: nats:2-alpine
container_name: nats
ports:
- "8222:8222"
- "4222:4222"
command: nats-server -js -m 8222 -D -l /dev/null
redis:
image: redis:7-alpine
container_name: redis
ports:
- "6379:6379"
# volumes:
# - ./data/redis:/data
command: redis-server --appendonly yes
relay:
depends_on:
- nats
- redis
container_name: relay
build:
context: .
dockerfile: docker/relay.dockerfile
ports:
- "50051:50051"
labels:
- "traefik.enable=true"
- "traefik.http.routers.relay.rule=Host(`frontend.docker.localhost`) && PathPrefix(`/relay/proto.chat.v1.ChatService`)"
- "traefik.http.services.relay.loadbalancer.server.scheme=h2c"
# Middleware
- "traefik.http.middlewares.relay-grpc.grpcWeb.allowOrigins=*"
- "traefik.http.middlewares.relay-stripprefix.stripprefix.prefixes=/relay"
- "traefik.http.middlewares.relay-headers.headers.accesscontrolalloworiginlist=*"
- "traefik.http.routers.relay.middlewares=relay-grpc,relay-headers,relay-stripprefix"
environment:
- PB_USER=admin@localhost.com
- PB_PASS=abcdefghijkl
frontend:
container_name: frontend
depends_on:
- nats
- redis
- relay
- pocketbase
build:
context: .
dockerfile: docker/frontend.dockerfile
ports:
- "3000:3000"
labels:
- "traefik.enable=true"
- "traefik.http.routers.frontend.rule=Host(`frontend.docker.localhost`)"
- "traefik.http.services.frontend.loadbalancer.server.scheme=http"
environment:
- PUBLIC_POCKETBASE_URL=http://frontend.docker.localhost/pocketbase
- PUBLIC_RELAY_URL=http://frontend.docker.localhost/relay
pocketbase:
container_name: pocketbase
image: inveracity/pocketbase:0.16.7
build:
context: .
dockerfile: docker/pocketbase.dockerfile
ports:
- 8090:8090
volumes:
- ./pb_data:/pb/pb_data
labels:
- "traefik.enable=true"
- "traefik.http.routers.pocketbase.rule=Host(`frontend.docker.localhost`) && PathPrefix(`/pocketbase`)"
- "traefik.http.services.pocketbase.loadbalancer.server.scheme=http"
- "traefik.http.routers.pocketbase.middlewares=pocketbase-stripprefix"
- "traefik.http.middlewares.pocketbase-stripprefix.stripprefix.prefixes=/pocketbase"
environment:
- PB_ADMIN_EMAIL=admin@localhost.com
- PB_ADMIN_PASS=abcdefghijkl