-
Notifications
You must be signed in to change notification settings - Fork 9
/
docker-compose.yml
64 lines (58 loc) · 1.39 KB
/
docker-compose.yml
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
version: '3.8'
services:
app:
container_name: nest-http
image: innei/nest-http-prisma-zod:latest
command: /bin/sh -c "./node_modules/.bin/prisma migrate deploy; node apps/core/dist/main.js --redis_host=redis --allowed_origins=${ALLOWED_ORIGINS} --jwt_secret=${JWT_SECRET} --color --cluster"
env_file:
- .env
environment:
- TZ=Asia/Shanghai
- NODE_ENV=production
- DATABASE_URL=postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@postgres:5432/nest-http?schema=public
restart: 'on-failure'
volumes:
- ./data/nest:/root/.nest
ports:
- '3333:3333'
depends_on:
- postgres
- redis
links:
- postgres
- redis
networks:
- app-network
postgres:
image: postgres:15
container_name: postgres
restart: always
ports:
- '15432:5432'
env_file:
- .env
volumes:
- nest-postgres:/var/lib/postgresql/data
environment:
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
- POSTGRES_USER=${POSTGRES_USER}
healthcheck:
test: ['CMD-SHELL', 'pg_isready -U nest-http']
interval: 30s
timeout: 10s
retries: 5
networks:
- app-network
redis:
image: redis
container_name: redis
ports:
- '6560:6379'
networks:
- app-network
networks:
app-network:
driver: bridge
volumes:
nest-postgres:
name: nest-postgres-db