-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
168 lines (158 loc) · 3.58 KB
/
Copy pathdocker-compose.yml
File metadata and controls
168 lines (158 loc) · 3.58 KB
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
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
services:
db:
build:
context: ./db
dockerfile: Dockerfile
container_name: rl-db-${ENV_TYPE:-dev}
ports:
- ${DB_PORT:-5432}:5432
environment:
POSTGRES_USER: ${POSTGRES_USER:-postgres}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-postgres}
POSTGRES_DB: ${POSTGRES_DB}
volumes:
- db-${ENV_TYPE:-dev}:/var/lib/postgresql/data
networks:
- db-api
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER} -d ${POSTGRES_DB}"]
interval: 10s
timeout: 5s
retries: 5
profiles:
- api
- full
api:
build:
context: ./api
dockerfile: docker/Dockerfile
container_name: rl-api
env_file:
- ./private/shared/secrets/.env
environment:
- POSTGRES_HOST=db
depends_on:
db:
condition: service_healthy
networks:
- db-api
- api-redis
- api-website-nginx
ports:
- ${API_PORT:-8080}:8080
profiles:
- api
- full
redis:
image: redis:latest
container_name: rl-redis
#ports:
# - ${REDIS_PORT:-6379}:6379
networks:
- api-redis
profiles:
- api
- full
website-prod:
build:
dockerfile: website/Dockerfile.${ENV_TYPE:-dev}
args:
NEXTAUTH_URL: ${NEXTAUTH_URL}
AUTH_SECRET: ${AUTH_SECRET}
AUTH_MICROSOFT_ENTRA_ID_ID: ${AUTH_MICROSOFT_ENTRA_ID_ID}
AUTH_MICROSOFT_ENTRA_ID_SECRET: ${AUTH_MICROSOFT_ENTRA_ID_SECRET}
API_KEY: ${API_KEY}
NEXT_TELEMETRY_DISABLED: 1
container_name: rl-website-prod
environment:
- NEXTAUTH_URL=${NEXTAUTH_URL:-http://localhost}
env_file:
- ./private/frontend/.env
- ./private/shared/secrets/.env
depends_on:
- api
networks:
- api-website-nginx
profiles:
- prod
website-dev:
extends:
service: website-prod
container_name: rl-website-dev
profiles:
- dev
volumes:
- ${WEBSITE_DEV_FOLDER:-./}src:/app/src
- ${WEBSITE_DEV_FOLDER:-./}public:/app/public
- ${WEBSITE_DEV_FOLDER:-./}next.config.js:/app/next.config.js
- ${WEBSITE_DEV_FOLDER:-./}tsconfig.json:/app/tsconfig.json
- website-next-cache:/app/.next
hardware-demo-1:
build:
context: ./hardware
dockerfile: Dockerfile
platform: linux/amd64
container_name: rl-hardware-demo-1
hostname: hardware-1
environment:
- API_KEY=${API_KEY}
networks:
- nginx-hardware
profiles:
- demo
ports:
- 1906:1906
hardware-demo-2:
build:
context: ./hardware
dockerfile: Dockerfile
platform: linux/amd64
container_name: rl-hardware-demo-2
hostname: hardware-2
environment:
- API_KEY=${API_KEY}
networks:
- nginx-hardware
profiles:
- demo
ports:
- 2000:1906
nginx:
image: nginx
container_name: rl-nginx
ports:
- 80:80
volumes:
- ./nginx/default.${ENV_TYPE:-dev}.conf:/etc/nginx/conf.d/default.conf
depends_on:
- api
- website-${ENV_TYPE:-dev}
networks:
- api-website-nginx
- nginx-cloudflare
- nginx-hardware
profiles:
- full
cloudflared:
image: cloudflare/cloudflared
container_name: rl-cloudflared
command: tunnel run
environment:
- TUNNEL_TOKEN=${CLOUDFLARE_TUNNEL_TOKEN}
networks:
- nginx-cloudflare
depends_on:
- nginx
profiles:
- prod
- cloudflare
networks:
db-api:
api-redis:
api-website-nginx:
nginx-cloudflare:
nginx-hardware:
volumes:
db-dev:
db-prod:
website-next-cache: