-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
77 lines (72 loc) · 1.71 KB
/
docker-compose.yml
File metadata and controls
77 lines (72 loc) · 1.71 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
version: '3.8'
services:
# Redis Cache Server
redis:
image: redis:7-alpine
ports:
- "6379:6379"
command: redis-server --appendonly yes
volumes:
- redis_data:/data
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 10s
timeout: 5s
retries: 5
start_period: 10s
restart: unless-stopped
networks:
- news-feed-network
# News API Proxy Server
proxy-server:
build:
context: ./server
dockerfile: Dockerfile
ports:
- "3001:3001"
environment:
- NODE_ENV=development
- PROXY_PORT=3001
- ALLOWED_ORIGINS=https://localhost:8443,http://localhost:3000
- REDIS_URL=redis://redis:6379
depends_on:
redis:
condition: service_healthy
healthcheck:
test: ["CMD", "node", "-e", "require('http').get('http://localhost:3001/health', (res) => process.exit(res.statusCode === 200 ? 0 : 1))"]
interval: 30s
timeout: 10s
retries: 3
start_period: 40s
restart: unless-stopped
networks:
- news-feed-network
# React Development Server (optional - can be run separately)
web:
build:
context: .
dockerfile: Dockerfile.dev
ports:
- "8443:8443"
environment:
- CHOKIDAR_USEPOLLING=true
- SASS_PATH=./node_modules;./src
- HTTPS=true
- PORT=8443
- REACT_APP_API_KEY=${REACT_APP_API_KEY}
- REACT_APP_PROXY_URL=http://proxy-server:3001
volumes:
- .:/app
- /app/node_modules
depends_on:
proxy-server:
condition: service_healthy
networks:
- news-feed-network
profiles:
- full-stack
volumes:
redis_data:
networks:
news-feed-network:
driver: bridge