-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.dev.yml
More file actions
128 lines (121 loc) · 3.84 KB
/
docker-compose.dev.yml
File metadata and controls
128 lines (121 loc) · 3.84 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
117
118
119
120
121
122
123
124
125
126
127
128
version: '3.8'
services:
# PostgreSQL Database for Development
postgres:
image: postgres:16-alpine
container_name: smartresponse-postgres-dev
restart: unless-stopped
environment:
POSTGRES_USER: ${DATABASE_USERNAME:-postgres}
POSTGRES_PASSWORD: ${DATABASE_PASSWORD:-postgres}
POSTGRES_DB: ${DATABASE_NAME:-smartresponse_dev}
PGDATA: /var/lib/postgresql/data/pgdata
ports:
- '${DATABASE_PORT:-5432}:5432'
volumes:
- postgres_dev_data:/var/lib/postgresql/data
- ./migrations:/docker-entrypoint-initdb.d
healthcheck:
test: ['CMD-SHELL', 'pg_isready -U ${DATABASE_USERNAME:-postgres}']
interval: 10s
timeout: 5s
retries: 5
networks:
- smartresponse-dev-network
# Redis Cache for Development
redis:
image: redis:7-alpine
container_name: smartresponse-redis-dev
restart: unless-stopped
command: redis-server --appendonly yes --requirepass ${REDIS_PASSWORD:-redispassword}
ports:
- '${REDIS_PORT:-6379}:6379'
volumes:
- redis_dev_data:/data
healthcheck:
test: ['CMD', 'redis-cli', '--raw', 'incr', 'ping']
interval: 10s
timeout: 3s
retries: 5
networks:
- smartresponse-dev-network
# NestJS Application in Development Mode
api:
build:
context: .
dockerfile: Dockerfile.dev
target: development
container_name: smartresponse-api-dev
restart: unless-stopped
ports:
- '${PORT:-3000}:3000'
- '9229:9229' # Debug port
environment:
NODE_ENV: development
PORT: 3000
DATABASE_URL: postgresql://${DATABASE_USERNAME:-postgres}:${DATABASE_PASSWORD:-postgres}@postgres:5432/${DATABASE_NAME:-smartresponse_dev}
REDIS_HOST: redis
REDIS_PORT: 6379
REDIS_PASSWORD: ${REDIS_PASSWORD:-redispassword}
JWT_SECRET: ${JWT_SECRET:-dev-secret-key}
JWT_EXPIRATION: ${JWT_EXPIRATION:-15m}
JWT_REFRESH_TOKEN_SECRET: ${JWT_REFRESH_TOKEN_SECRET:-dev-refresh-secret}
JWT_REFRESH_TOKEN_EXPIRATION: ${JWT_REFRESH_TOKEN_EXPIRATION:-7d}
GOOGLE_CLIENT_ID: ${GOOGLE_CLIENT_ID}
GOOGLE_CLIENT_SECRET: ${GOOGLE_CLIENT_SECRET}
GOOGLE_CALLBACK_URL: ${GOOGLE_CALLBACK_URL:-http://localhost:3000/api/v1/auth/google/callback}
OPENAI_API_KEY: ${OPENAI_API_KEY}
TYPEORM_SYNC: ${TYPEORM_SYNC:-true}
TYPEORM_LOGGING: ${TYPEORM_LOGGING:-true}
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
networks:
- smartresponse-dev-network
volumes:
- .:/app
- /app/node_modules
- ./uploads:/app/uploads
command: pnpm run start:debug
# pgAdmin for Development
pgadmin:
image: dpage/pgadmin4:latest
container_name: smartresponse-pgadmin-dev
restart: unless-stopped
environment:
PGADMIN_DEFAULT_EMAIL: ${PGADMIN_EMAIL:-admin@admin.com}
PGADMIN_DEFAULT_PASSWORD: ${PGADMIN_PASSWORD:-admin}
PGADMIN_CONFIG_SERVER_MODE: 'False'
ports:
- '${PGADMIN_PORT:-5050}:80'
depends_on:
- postgres
networks:
- smartresponse-dev-network
volumes:
- pgadmin_dev_data:/var/lib/pgadmin
# Redis Commander for Development
redis-commander:
image: rediscommander/redis-commander:latest
container_name: smartresponse-redis-commander-dev
restart: unless-stopped
environment:
REDIS_HOSTS: local:redis:6379:0:${REDIS_PASSWORD:-redispassword}
ports:
- '${REDIS_COMMANDER_PORT:-8081}:8081'
depends_on:
- redis
networks:
- smartresponse-dev-network
networks:
smartresponse-dev-network:
driver: bridge
volumes:
postgres_dev_data:
driver: local
redis_dev_data:
driver: local
pgadmin_dev_data:
driver: local