Skip to content

Commit b08a931

Browse files
committed
switch to using port 3000 between backend and frontend
1 parent 22372cb commit b08a931

2 files changed

Lines changed: 8 additions & 4 deletions

File tree

README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ As an alternative to the local development setup above, you can use containers f
173173
container run \
174174
--name frontend \
175175
--remove \
176-
--env VITE_API_URL=http://localhost:5000 \
176+
--env VITE_API_URL=http://localhost:3000 \
177177
-v ./frontend/src:/app/src:ro \
178178
-v ./frontend/public:/app/public:ro \
179179
-v ./frontend/index.html:/app/index.html:ro \
@@ -204,7 +204,7 @@ As an alternative to the local development setup above, you can use containers f
204204
-v ./backend/tests:/app/tests:ro \
205205
-v ./backend/scripts:/app/scripts:ro \
206206
-v ${GOOGLE_APPLICATION_CREDENTIALS_HOST}:/app/secrets/google-creds.json \
207-
--publish 5000:5000 \
207+
--publish 3000:5000 \
208208
backend-dev:latest &
209209
# execute interactive shell in backend container
210210
container exec -it backend /bin/sh
@@ -226,6 +226,7 @@ As an alternative to the local development setup above, you can use containers f
226226

227227
on MacOS with `apple/container`
228228
```bash
229+
cd backend && make clean # __pycache__ dirs are bind'd-in to containers as read-only so delete them
229230
container exec backend make lint
230231
container exec backend make typecheck
231232
container exec backend make test
@@ -258,6 +259,7 @@ docker compose down
258259
On MacOS with [`apple/container`](https://github.com/apple/container) (>= 0.9.0):
259260
```bash
260261
container stop --all
262+
container system stop
261263
```
262264

263265
### Troubleshooting

docker-compose.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ services:
77
TYPE: dev
88
container_name: tenantfirstaid-backend-dev
99
ports:
10-
- "5000:5000"
10+
# we map port 3000 on the host to avoid MacOS conflict with ControlCenter
11+
- "3000:5000"
1112
volumes:
1213
# Mount source for hot reload
1314
- ./backend/tenantfirstaid:/app/tenantfirstaid:ro
@@ -39,6 +40,7 @@ services:
3940
TYPE: dev
4041
container_name: tenantfirstaid-frontend-dev
4142
ports:
43+
# Map port 5173 in the container to port 5173 on the host for Vite dev server
4244
- "5173:5173"
4345
volumes:
4446
# Mount source for hot reload
@@ -47,7 +49,7 @@ services:
4749
- ./frontend/index.html:/app/index.html:ro
4850
- ./frontend/vite.config.ts:/app/vite.config.ts:ro
4951
environment:
50-
- VITE_API_URL=http://localhost:5000
52+
- VITE_API_URL=http://localhost:3000
5153
depends_on:
5254
- backend
5355
networks:

0 commit comments

Comments
 (0)