File tree Expand file tree Collapse file tree 4 files changed +55
-18
lines changed Expand file tree Collapse file tree 4 files changed +55
-18
lines changed Original file line number Diff line number Diff line change
1
+ FROM mcr.microsoft.com/devcontainers/python:3.12-bookworm
Original file line number Diff line number Diff line change
1
+ {
2
+ "build" : {
3
+ "dockerfile" : " Dockerfile" ,
4
+ "context" : " .."
5
+ },
6
+ "features" : {
7
+ "ghcr.io/defanglabs/devcontainer-feature/defang-cli:1.0.4" : {},
8
+ "ghcr.io/devcontainers/features/docker-in-docker:2" : {},
9
+ "ghcr.io/devcontainers/features/aws-cli:1" : {}
10
+ }
11
+ }
Original file line number Diff line number Diff line change
1
+ services :
2
+ db :
3
+ extends :
4
+ file : compose.yaml
5
+ service : db
6
+ volumes :
7
+ - postgres_data:/var/lib/postgresql/data
8
+ environment :
9
+ - POSTGRES_PASSWORD=password
10
+
11
+ runmigrations :
12
+ extends :
13
+ file : compose.yaml
14
+ service : django
15
+ restart : on-failure
16
+ environment :
17
+ - DEBUG=False
18
+ - POSTGRES_PASSWORD=password
19
+ command : python manage.py migrate
20
+ depends_on :
21
+ - db
22
+
23
+ django :
24
+ extends :
25
+ file : compose.yaml
26
+ service : django
27
+ environment :
28
+ - DEBUG=False
29
+ - POSTGRES_PASSWORD=password
30
+ volumes :
31
+ - " ./app:/code"
32
+ command : python manage.py runserver 0.0.0.0:8000
33
+ depends_on :
34
+ - runmigrations
35
+
36
+ volumes :
37
+ postgres_data:
Original file line number Diff line number Diff line change @@ -2,38 +2,26 @@ services:
2
2
db :
3
3
restart : unless-stopped
4
4
image : postgres:16
5
- volumes : ["./tmp/postgres:/var/lib/postgresql/data/"]
6
5
environment :
7
- - POSTGRES_DB=mydatabase
8
- - POSTGRES_USER=myuser
6
+ - POSTGRES_DB=django
7
+ - POSTGRES_USER=django
9
8
- POSTGRES_PASSWORD
10
9
ports :
11
10
- mode : host
12
11
target : 5432
13
- # deploy:
14
- # resources:
15
- # reservations:
16
- # memory: 256M
17
12
18
- django-crm :
13
+ django :
19
14
restart : unless-stopped
20
15
build : ./app
21
16
ports :
22
17
- mode : ingress
23
18
target : 8000
24
- # Uncomment the following line if you want to run it locally
25
- # published: 8000
19
+ published : 8000
26
20
environment :
27
21
- DB_HOST=db
28
22
- DEBUG=False
29
- - POSTGRES_USER=myuser
30
- - POSTGRES_DB=mydatabase
23
+ - POSTGRES_USER=django
24
+ - POSTGRES_DB=django
31
25
- POSTGRES_PASSWORD
32
- # deploy:
33
- # resources:
34
- # reservations:
35
- # memory: 2GB
36
- # volumes: [".:/code"]
37
26
depends_on :
38
27
- db
39
- # command: python manage.py runserver 0.0.0.0:8000
You can’t perform that action at this time.
0 commit comments