-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.dev.yml
More file actions
116 lines (111 loc) · 3.21 KB
/
docker-compose.dev.yml
File metadata and controls
116 lines (111 loc) · 3.21 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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
services:
# PostgreSQL Database
postgres:
build:
context: ./backend/sql
dockerfile: Dockerfile.postgres
container_name: citypulse-postgres-dev
environment:
POSTGRES_USER: ${POSTGRES_USER:-citypulse_user}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-citypulse_dev_password}
POSTGRES_DB: ${POSTGRES_DB:-citypulse_dev}
ports:
- "5432:5432"
volumes:
- postgres_data_dev:/var/lib/postgresql/data
networks:
- citypulse-network
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-citypulse_user} -d ${POSTGRES_DB:-citypulse_dev}"]
interval: 10s
timeout: 5s
retries: 5
start_period: 30s
restart: unless-stopped
# pgAdmin for Database GUI (Optional)
pgadmin:
image: dpage/pgadmin4:latest
container_name: citypulse-pgadmin-dev
environment:
PGADMIN_DEFAULT_EMAIL: admin@citypulse.com
PGADMIN_DEFAULT_PASSWORD: admin123
PGADMIN_CONFIG_SERVER_MODE: 'False'
ports:
- "8080:80"
depends_on:
postgres:
condition: service_healthy
networks:
- citypulse-network
volumes:
- pgadmin_data_dev:/var/lib/pgadmin
restart: unless-stopped
# Backend API Service
backend:
build:
context: .
dockerfile: backend/Dockerfile.dev
container_name: citypulse-backend-dev
environment:
NODE_ENV: development
PORT: 5000
DB_HOST: postgres
DB_PORT: 5432
DB_NAME: ${POSTGRES_DB:-citypulse_dev}
DB_USER: ${POSTGRES_USER:-citypulse_user}
DB_PASSWORD: ${POSTGRES_PASSWORD:-citypulse_dev_password}
DATABASE_URL: postgresql://${POSTGRES_USER:-citypulse_user}:${POSTGRES_PASSWORD:-citypulse_dev_password}@postgres:5432/${POSTGRES_DB:-citypulse_dev}
JWT_SECRET: ${JWT_SECRET}
JWT_REFRESH_SECRET: ${JWT_REFRESH_SECRET}
GOOGLE_CLIENT_ID: ${GOOGLE_CLIENT_ID}
GOOGLE_CLIENT_SECRET: ${GOOGLE_CLIENT_SECRET}
EMAIL_HOST: ${EMAIL_HOST}
EMAIL_PORT: ${EMAIL_PORT}
EMAIL_USER: ${EMAIL_USER}
EMAIL_PASS: ${EMAIL_PASS}
EMAIL_SENDGRID_API_KEY: ${EMAIL_SENDGRID_API_KEY}
FRONTEND_URL: http://localhost:3001
ports:
- "5001:5000"
depends_on:
postgres:
condition: service_healthy
networks:
- citypulse-network
volumes:
- backend_uploads_dev:/workspace/backend/uploads
stdin_open: true
tty: true
restart: unless-stopped
command: sh -c "cd /workspace/backend && pnpm dev"
# Frontend Service
frontend:
build:
context: .
dockerfile: frontend/Dockerfile.dev
container_name: citypulse-frontend-dev
environment:
NODE_ENV: development
VITE_API_URL: http://localhost:5001
VITE_GOOGLE_CLIENT_ID: ${VITE_GOOGLE_CLIENT_ID}
VITE_GOOGLE_REDIRECT_URI: ${VITE_GOOGLE_REDIRECT_URI}
ports:
- "3001:3000"
depends_on:
- backend
networks:
- citypulse-network
stdin_open: true
tty: true
restart: unless-stopped
command: sh -c "cd /workspace/frontend && pnpm dev --host 0.0.0.0 --port 3000"
volumes:
postgres_data_dev:
driver: local
pgadmin_data_dev:
driver: local
backend_uploads_dev:
driver: local
networks:
citypulse-network:
driver: bridge