-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
123 lines (117 loc) · 2.81 KB
/
Copy pathdocker-compose.yml
File metadata and controls
123 lines (117 loc) · 2.81 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
services:
postgres:
image: postgres:18-alpine
container_name: communityhub-postgres
env_file:
- ./.env
environment:
POSTGRES_DB: ${DB_DATABASE}
POSTGRES_USER: ${DB_USERNAME}
POSTGRES_PASSWORD: ${DB_PASSWORD}
POSTGRES_INITDB_ARGS: "--encoding=UTF8 --lc-collate=C --lc-ctype=C"
ports:
- "5433:5432"
volumes:
- postgres_data:/var/lib/postgresql
- ./backend/docker/postgres/init.sql:/docker-entrypoint-initdb.d/init.sql:ro
networks:
- communityhub-network
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${DB_USERNAME} -d ${DB_DATABASE}"]
interval: 10s
timeout: 5s
retries: 5
restart: unless-stopped
redis:
image: redis:7-alpine
container_name: communityhub-redis
ports:
- "6379:6379"
volumes:
- redis_data:/data
networks:
- communityhub-network
command: redis-server --appendonly yes
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 10s
timeout: 5s
retries: 5
restart: unless-stopped
backend:
build:
context: ./backend
dockerfile: Dockerfile
target: development
container_name: communityhub-backend
env_file:
- ./.env
environment:
NODE_ENV: development
PORT: 3000
DB_HOST: postgres
DB_PORT: 5432
REDIS_HOST: redis
REDIS_PORT: 6379
FRONTEND_URL: http://localhost:3001
command: ["npm", "run", "start:dev"]
ports:
- "3000:3000"
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
volumes:
- ./backend:/usr/src/app
- /usr/src/app/node_modules
networks:
- communityhub-network
restart: unless-stopped
frontend:
build:
context: ./frontend
dockerfile: Dockerfile
target: development
container_name: communityhub-frontend
environment:
NODE_ENV: development
NEXT_PUBLIC_BACKEND_URL: http://localhost:3000/api
command: ["npm", "run", "dev", "--", "-H", "0.0.0.0"]
ports:
- "3001:3000"
depends_on:
- backend
volumes:
- ./frontend:/app
- /app/node_modules
networks:
- communityhub-network
restart: unless-stopped
pgadmin:
image: dpage/pgadmin4:latest
container_name: communityhub-pgadmin
env_file:
- ./.env
environment:
PGADMIN_DEFAULT_EMAIL: ${PGADMIN_DEFAULT_EMAIL}
PGADMIN_DEFAULT_PASSWORD: ${PGADMIN_DEFAULT_PASSWORD}
ports:
- "5050:80"
volumes:
- pgadmin_data:/var/lib/pgadmin
networks:
- communityhub-network
profiles:
- tools
restart: unless-stopped
volumes:
postgres_data:
driver: local
redis_data:
driver: local
pgadmin_data:
driver: local
networks:
communityhub-network:
driver: bridge