-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcompose.yaml
49 lines (45 loc) · 1.36 KB
/
compose.yaml
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
services:
ui:
build:
context: ./frontend
ports:
- 8080:80
depends_on:
- api
develop:
watch:
- action: rebuild
path: ./frontend/src
target: /frontend/src
ignore:
- node_modules/
api:
build:
context: ./backend
depends_on:
- database
- redis
environment:
- MONGODB_CONNECTION_STRING=mongodb://database:27017
ports:
- 127.0.0.1:3000:3000
develop:
watch:
- action: rebuild
path: ./backend/src
target: /backend/src
ignore:
- node_modules/
database:
build: ./database
ports:
- 27017:27017
redis:
image: redis:latest
ports:
- 6379:6379
# The UI ran into an issue with recognizing the service name of the API unless I made an explicit network
# This was originally driving me crazy since the API and DB did not have this issue, and the default Docker network should be able to resolve the name
# The following is good explanation, it was being called from the browser, not in docker, and was unable to resolve that endpoint
# https://stackoverflow.com/questions/77060233/unknown-host-error-calling-containerized-backend-from-frontend
# I like the suggestion of a reverse proxy as a solution, but for now will expose localhost on api service for dev purposes