-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
113 lines (107 loc) · 2.79 KB
/
docker-compose.yml
File metadata and controls
113 lines (107 loc) · 2.79 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
version: '3.8'
services:
postgres:
image: postgres:15-alpine
container_name: cryptobot-postgres
environment:
POSTGRES_DB: cryptobot_dev
POSTGRES_USER: cryptobot
POSTGRES_PASSWORD: dev_password_123
POSTGRES_HOST_AUTH_METHOD: trust
ports:
- "5432:5432"
volumes:
- postgres_data:/var/lib/postgresql/data
- ./backend/prisma/init.sql:/docker-entrypoint-initdb.d/init.sql:ro
networks:
- cryptobot-network
healthcheck:
test: ["CMD-SHELL", "pg_isready -U cryptobot -d cryptobot_dev"]
interval: 10s
timeout: 5s
retries: 5
redis:
image: redis:7-alpine
container_name: cryptobot-redis
ports:
- "6379:6379"
volumes:
- redis_data:/data
networks:
- cryptobot-network
command: redis-server --appendonly yes
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 10s
timeout: 3s
retries: 3
backend:
build:
context: .
dockerfile: backend/Dockerfile
container_name: cryptobot-backend
environment:
NODE_ENV: development
PORT: 5000
DATABASE_URL: postgresql://cryptobot:dev_password_123@postgres:5432/cryptobot_dev
REDIS_URL: redis://redis:6379
JWT_SECRET: dev_jwt_secret_key_not_for_production
CORS_ORIGIN: http://localhost:3000
ports:
- "5000:5000"
volumes:
- ./backend:/app/backend:ro
- ./packages:/app/packages:ro
- node_modules:/app/node_modules
- backend_node_modules:/app/backend/node_modules
networks:
- cryptobot-network
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
restart: unless-stopped
command: npm run dev
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:5000/health"]
interval: 30s
timeout: 10s
retries: 3
frontend:
build:
context: .
dockerfile: frontend/Dockerfile
target: development
container_name: cryptobot-frontend
environment:
NODE_ENV: development
VITE_API_URL: http://localhost:5000
VITE_WS_URL: ws://localhost:5000
ports:
- "3000:3000"
volumes:
- ./frontend:/app/frontend:ro
- ./packages:/app/packages:ro
- frontend_node_modules:/app/frontend/node_modules
networks:
- cryptobot-network
depends_on:
- backend
restart: unless-stopped
command: npm run dev -- --host 0.0.0.0
networks:
cryptobot-network:
driver: bridge
name: cryptobot-network
volumes:
postgres_data:
name: cryptobot-postgres-data
redis_data:
name: cryptobot-redis-data
node_modules:
name: cryptobot-node-modules
backend_node_modules:
name: cryptobot-backend-node-modules
frontend_node_modules:
name: cryptobot-frontend-node-modules