-
Notifications
You must be signed in to change notification settings - Fork 11
/
docker-compose.yml
58 lines (51 loc) · 1.3 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
version: '3'
# Define the services/containers to be run
services:
mello-backend: #name of your service
container_name: mello-backend
build: ./ # specify the directory of the Dockerfile
#image: node:10.19.0
command: npm run start:prod
ports:
- "5001:5001" #specify ports forwarding
networks:
- mello
links:
- database # link this service to the database service
- cache
volumes:
- nodemodules:/usr/src/app/node_modules
- .:/usr/src/app
depends_on:
- database
environment:
DATABASE_URL: postgres://postgres:eatsleepcode@database:5432/mello
working_dir: /usr/src/app
database: # name of the service
image: postgres:11.7 # specify image to build container from
container_name: mello-postgres
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: eatsleepcode
POSTGRES_DB: mello
networks:
- mello
volumes:
- psql:/var/lib/postgresql/data
ports:
- 5432:5432
cache: #name of the service
image: redis:6
container_name: mello-cache
networks:
- mello
ports:
- 6379:6379
volumes:
- $PWD/redis-data:/var/lib/redis
- $PWD/redis.conf:/usr/local/etc/redis/redis.conf
volumes:
nodemodules:
psql:
networks:
mello: