-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
74 lines (67 loc) · 1.75 KB
/
docker-compose.yml
File metadata and controls
74 lines (67 loc) · 1.75 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
version: '3'
services:
# should starts before api
api_db:
container_name: docker-api-db
image: mongo:latest
volumes:
- mongodb_api:/data/db
api:
build: ./api
container_name: docker-api
command: npm run start
restart: unless-stopped
ports:
# left number - our machine port,
# right number - our docker container port
- "3001:3001"
environment:
# variables should be provided without any spaces!!!
# env values that can be ported to js files and be accessible via 'process.env .... '
- PORT=3001
- HOST=http://test-docker.com
# api_db ... host of our aservice, should have same name that has our service for db
- MONGO_URL=mongodb://api_db:27017/api
- AUTH_API_URL=http://auth:3002/api
depends_on:
# express what should this service wait before starts, first will be inited api_db
- api_db
volumes:
- ./api/src:/usr/src/app/src
auth_db:
image: mongo:latest
container_name: docker-auth-db
volumes:
- mongodb_auth:/data/db
auth:
build: ./auth
container_name: docker-auth
command: npm run start
restart: unless-stopped
ports:
- "3002:3002"
environment:
- PORT=3002
- HOST=http://test-docker.com
- MONGO_URL=mongodb://auth_db:27017/auth
depends_on:
- auth_db
frontend:
build: ./frontend
container_name: docker-frontend
command: serve -s build -l 3000
ports:
- "3000:3000"
restart: unless-stopped
nginx:
image: nginx:stable-alpine
container_name: docker-nginx
ports:
- "80:80"
volumes:
- ./nginx/nginx.conf.prod:/etc/nginx/conf.d/nginx.conf
depends_on:
- frontend
volumes:
mongodb_api:
mongodb_auth: