-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
72 lines (67 loc) · 1.58 KB
/
docker-compose.yml
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
version: '3.9'
services:
postgres:
container_name: postgres_rentx_container
image: ${DB_IMAGE}
restart: always
environment:
- POSTGRES_DB=${DB_DATABASE}
- POSTGRES_USER=${DB_USER}
- POSTGRES_PASSWORD=${DB_PASSWORD}
volumes:
- ./data:/data/postgres
ports:
- ${DB_PORT}:5432
mongo:
container_name: mongo_rentx_container
image: ${MONGO_IMAGE}
restart: always
volumes:
- ./data:/data/mongo
environment:
MONGODB_DATABASE: ${DB_DATABASE}
MONGODB_USERNAME: ${MONGO_USER}
MONGODB_PASSWORD: ${MONGO_PASSWORD}
ports:
- ${MONGO_PORT}:27017
redis:
container_name: redis_rentx_container
image: ${REDIS_IMAGE}
ports:
- ${REDIS_PORT}:6379
environment:
- REDIS_PASSWORD=${REDIS_PASSWORD}
volumes:
- ./data:/data/redis
api:
container_name: api_rentx_container
image: node:12
working_dir: /usr/app/
restart: always
command: bash -c "npm install --only=prod && npx typeorm migration:run && npm run debug"
volumes:
- ./dist:/usr/app/dist/
- ./package.json:/usr/app/package.json
- ./ormconfig.json:/usr/app/ormconfig.json
- ./.env:/usr/app/.env
environment:
- MONGO_URL=mongodb://mongo:${MONGO_PORT}/${DB_DATABASE}
ports:
- ${SERVER_PORT}:3333
- 9229:9229
logging:
driver: 'json-file'
options:
max-size: '10m'
max-file: '5'
links:
- postgres
- mongo
- redis
depends_on:
- postgres
- mongo
- redis
volumes:
data:
driver: local