-
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdocker-compose.staging.yml
More file actions
92 lines (86 loc) · 2.27 KB
/
docker-compose.staging.yml
File metadata and controls
92 lines (86 loc) · 2.27 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
services:
postgres:
image: postgres:18-alpine
container_name: webdevstudios-postgres-staging
restart: always
environment:
POSTGRES_USER: ${POSTGRES_USER}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
POSTGRES_DB: ${POSTGRES_DB}
volumes:
- postgres_staging_data:/var/lib/postgresql/data
healthcheck:
test: ['CMD-SHELL', 'pg_isready -U ${POSTGRES_USER}']
interval: 10s
timeout: 5s
retries: 5
networks:
- staging-network
redis:
image: redis:8.4.0-alpine
container_name: webdevstudios-redis-staging
restart: always
command: redis-server --requirepass ${REDIS_PASSWORD}
volumes:
- redis_staging_data:/data
healthcheck:
test: ['CMD', 'redis-cli', '-a', '${REDIS_PASSWORD}', 'ping']
interval: 10s
timeout: 5s
retries: 5
networks:
- staging-network
web:
image: ghcr.io/${GITHUB_REPOSITORY}/web:staging
container_name: webdevstudios-web-staging
restart: always
environment:
NODE_ENV: production
PORT: 3000
NEXT_PUBLIC_API_URL: ${API_URL}
depends_on:
- api
networks:
- staging-network
api:
image: ghcr.io/${GITHUB_REPOSITORY}/api:staging
container_name: webdevstudios-api-staging
restart: always
environment:
NODE_ENV: production
PORT: 4000
DATABASE_URL: postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@postgres:5432/${POSTGRES_DB}
REDIS_URL: redis://:${REDIS_PASSWORD}@redis:6379
JWT_SECRET: ${JWT_SECRET}
JWT_EXPIRES_IN: ${JWT_EXPIRES_IN}
AWS_ACCESS_KEY_ID: ${AWS_ACCESS_KEY_ID}
AWS_SECRET_ACCESS_KEY: ${AWS_SECRET_ACCESS_KEY}
AWS_REGION: ${AWS_REGION}
AWS_S3_BUCKET: ${AWS_S3_BUCKET}
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
networks:
- staging-network
nginx:
image: nginx:1.29.4
container_name: webdevstudios-nginx-staging
restart: always
ports:
- '80:80'
volumes:
- ./nginx/nginx.conf:/etc/nginx/nginx.conf:ro
- ./nginx/logs:/var/log/nginx
depends_on:
- web
- api
networks:
- staging-network
volumes:
postgres_staging_data:
redis_staging_data:
networks:
staging-network:
driver: bridge