Skip to content

Commit 4980d20

Browse files
committed
added named volumes to docker compose
1 parent badad98 commit 4980d20

File tree

2 files changed

+8
-18
lines changed

2 files changed

+8
-18
lines changed

docker-compose.yml

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,20 +27,15 @@ nginx:
2727
postgres:
2828
restart: always
2929
image: postgres:latest
30-
volumes_from:
31-
- data
3230
ports:
3331
- "5432:5432"
32+
volumes:
33+
- pgdata:/var/lib/postgresql/data/
3434

3535
redis:
3636
restart: always
3737
image: redis:latest
3838
ports:
3939
- "6379:6379"
40-
41-
data:
42-
restart: always
43-
image: postgres:latest
4440
volumes:
45-
- /var/lib/postgresql
46-
command: "true"
41+
- redisdata:/data

production.yml

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -24,20 +24,15 @@ nginx:
2424
postgres:
2525
restart: always
2626
image: postgres:latest
27-
volumes_from:
28-
- data
2927
ports:
30-
- "5432:5432"
28+
- "5432"
29+
volumes:
30+
- pgdata:/var/lib/postgresql/data/
3131

3232
redis:
3333
restart: always
3434
image: redis:latest
3535
ports:
36-
- "6379:6379"
37-
38-
data:
39-
restart: always
40-
image: postgres:latest
36+
- "6379"
4137
volumes:
42-
- /var/lib/postgresql
43-
command: "true"
38+
- redisdata:/data

0 commit comments

Comments
 (0)