-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathcompose.yaml
More file actions
84 lines (79 loc) · 2 KB
/
Copy pathcompose.yaml
File metadata and controls
84 lines (79 loc) · 2 KB
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
73
74
75
76
77
78
79
80
81
82
83
84
volumes:
postgres_data:
pgadmin_data:
static_volume:
media_volume:
services:
# PostgreSQL database with PostGIS extension (multi-architecture support)
db:
image: nickblah/postgis:latest
volumes:
- postgres_data:/var/lib/postgresql/data/
environment:
- POSTGRES_DB=urban_tree_db
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=postgres
ports:
- "5432:5432"
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 10s
timeout: 5s
retries: 5
# Django backend API
backend:
build: ./backend
command: python manage.py runserver 0.0.0.0:8000
volumes:
- ./backend:/app
- static_volume:/app/staticfiles
- media_volume:/app/media
ports:
- "8000:8000"
environment:
- DEBUG=1
- SECRET_KEY=dev_secret_key
- DATABASE_URL=postgis://postgres:postgres@db:5432/urban_tree_db
- ALLOWED_HOSTS=localhost,127.0.0.1
- STATIC_ROOT=/app/staticfiles
- MEDIA_ROOT=/app/media
depends_on:
db:
condition: service_healthy
# Database reset service - use this to reset the database
db-reset:
image: nickblah/postgis:latest
volumes:
- postgres_data:/var/lib/postgresql/data/
environment:
- POSTGRES_DB=urban_tree_db
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=postgres
command: bash -c "rm -rf /var/lib/postgresql/data/* && exit"
profiles:
- reset
# Angular frontend
frontend:
build: ./frontend
command: npm start -- --host 0.0.0.0 --poll=2000
volumes:
- ./frontend:/app
- /app/node_modules
ports:
- "4200:4200"
environment:
- NODE_ENV=development
depends_on:
- backend
# PgAdmin for database management (optional)
pgadmin:
image: dpage/pgadmin4
environment:
- PGADMIN_DEFAULT_EMAIL=admin@omdena.com
- PGADMIN_DEFAULT_PASSWORD=admin
ports:
- "5050:80"
depends_on:
- db
volumes:
- pgadmin_data:/var/lib/pgadmin