Skip to content

Commit 569b395

Browse files
authoredJun 16, 2021
issue #2 use locally saved postgres data using docker --volume (#130)
1 parent 95a0479 commit 569b395

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed
 

‎.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@
55
.vscode
66
.config/
77
.python_history
8+
postgres/*

‎docker-compose.yaml

+9-4
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,15 @@ version: "3.3"
22

33
services:
44

5-
backend:
5+
turbocommerce_backend:
6+
image: turbocommerce_backend
7+
container_name: turbocommerce_backend
68
build:
79
context: .
810
dockerfile: backend/Dockerfile
9-
command: python3 backend/src/manage.py runsslserver 0.0.0.0:8000
11+
command: ["python3", "backend/src/manage.py", "runsslserver", "0.0.0.0:8000"]
1012
depends_on:
11-
- db
13+
- turbocommerce_db
1214
ports:
1315
- "8000:8000"
1416
restart: always
@@ -17,9 +19,12 @@ services:
1719
stdin_open: true
1820
tty: true
1921

20-
db:
22+
turbocommerce_db:
2123
image: postgres
24+
container_name: turbocommerce_db
2225
expose:
2326
- "5432"
2427
env_file:
2528
- backend/.env.local
29+
volumes:
30+
- ./postgres:/var/lib/postgresql/data

0 commit comments

Comments
 (0)
Please sign in to comment.