Skip to content

Commit 676f6c7

Browse files
authored
Local deploy tagging (#1134)
* added profiled services and prevented nginx loop when profiled services are inactive * update local development guide in docs to include profile information
1 parent 9db8b2f commit 676f6c7

3 files changed

Lines changed: 53 additions & 8 deletions

File tree

apps/docs/src/getting-started/local-development.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,35 @@ docker compose down
8181
docker compose up --build -d
8282
```
8383

84+
## Docker Compose Profiles
85+
86+
By default, running `docker compose up -d` starts only the **core stack** (backend, frontend, MongoDB, Redis). Additional services are **opt-in** and can be enabled using Docker Compose profiles.
87+
88+
Profiles allow you to start only the services you need for your workflow, keeping local development less resource-intensive.
89+
90+
- `ag` — AG frontend
91+
http://localhost:3001
92+
93+
- `staff` — Staff dashboard
94+
http://localhost:3002
95+
96+
- `semantic-search` — Semantic course search
97+
http://localhost:3010
98+
99+
- `docs` — Docs + Storybook
100+
http://localhost:3003 / http://localhost:3005
101+
102+
- `dev` — MinIO (staff photo uploads)
103+
http://localhost:3006
104+
105+
```sh
106+
# Start core + staff dashboard
107+
docker compose --profile staff up -d
108+
109+
# Start multiple profiles
110+
docker compose --profile ag --profile staff up -d
111+
```
112+
84113
## Ports
85114
`docker compose up` will automatically setup certain services on your localhost ports. By default, `DEV_PORT_PREFIX` is set to `30`, which means services will be available on ports starting with `30XX`. You can adjust this by setting the `DEV_PORT_PREFIX` environment variable if you need to run multiple instances of the repository in parallel (e.g., for git worktree setups).
86115

docker-compose.yml

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ services:
3232
- ./apps/backend:/backend/apps/backend
3333
- ./packages:/backend/packages
3434
semantic-search:
35+
profiles:
36+
- semantic-search
3537
build:
3638
context: ./apps/semantic-search
3739
dockerfile: Dockerfile
@@ -59,6 +61,8 @@ services:
5961
- ./apps/frontend:/frontend/apps/frontend
6062
- ./packages:/frontend/packages
6163
ag-frontend:
64+
profiles:
65+
- ag
6266
build:
6367
context: .
6468
dockerfile: ./apps/ag-frontend/Dockerfile
@@ -70,6 +74,8 @@ services:
7074
- ./apps/ag-frontend:/ag-frontend/apps/ag-frontend
7175
- ./packages:/ag-frontend/packages
7276
staff-frontend:
77+
profiles:
78+
- staff
7379
build:
7480
context: .
7581
dockerfile: ./apps/staff-frontend/Dockerfile
@@ -177,10 +183,6 @@ services:
177183
condition: service_healthy
178184
frontend:
179185
condition: service_started
180-
ag-frontend:
181-
condition: service_started
182-
staff-frontend:
183-
condition: service_started
184186
image: nginx:1.21
185187
networks:
186188
- bt
@@ -224,6 +226,8 @@ services:
224226
redis-cli -h redis FLUSHALL
225227
echo "Flushed redis cache on startup."
226228
storybook:
229+
profiles:
230+
- docs
227231
build:
228232
context: .
229233
dockerfile: ./apps/storybook/Dockerfile
@@ -237,6 +241,8 @@ services:
237241
- ./packages/theme:/storybook/packages/theme
238242
- ./apps/storybook:/storybook/apps/storybook
239243
docs:
244+
profiles:
245+
- docs
240246
build:
241247
context: .
242248
dockerfile: ./apps/docs/Dockerfile

nginx.conf

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,9 @@ server {
4141
server_name localhost;
4242
access_log off;
4343

44+
#Docker's embedded DNS in order to resolve upstream names at request time
45+
resolver 127.0.0.11 valid=5s;
46+
4447
# Backend API
4548
location /api {
4649
proxy_set_header Host $http_host;
@@ -63,9 +66,11 @@ server {
6366
proxy_pass http://backend:5001;
6467
}
6568

66-
# Frontend
69+
# Frontend (ag-frontend is a profiled service)
6770
location / {
68-
proxy_pass http://ag-frontend:3001;
71+
# (use a variable so DNS resolves at request time)
72+
set $ag_frontend http://ag-frontend:3001;
73+
proxy_pass $ag_frontend;
6974

7075
# Ensure Nginx properly handles WebSocket requests
7176
proxy_http_version 1.1;
@@ -79,6 +84,9 @@ server {
7984
server_name localhost;
8085
access_log off;
8186

87+
#Docker's embedded DNS in order to resolve upstream names at request time
88+
resolver 127.0.0.11 valid=5s;
89+
8290
# Backend API
8391
location /api {
8492
proxy_set_header Host $http_host;
@@ -101,9 +109,11 @@ server {
101109
proxy_pass http://backend:5001;
102110
}
103111

104-
# Frontend
112+
# Frontend (staff-frontend is a profiled service)
105113
location / {
106-
proxy_pass http://staff-frontend:3002;
114+
# (use a variable so DNS resolves at request time)
115+
set $staff_frontend http://staff-frontend:3002;
116+
proxy_pass $staff_frontend;
107117

108118
# Ensure Nginx properly handles WebSocket requests
109119
proxy_http_version 1.1;

0 commit comments

Comments
 (0)