-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yaml
44 lines (44 loc) · 1.08 KB
/
docker-compose.yaml
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
version: '3'
services:
# mongo:
# image: mongo
# ports:
# - '27017:27017'
# restart: on-failure
# environment:
# MONGO_INITDB_ROOT_USERNAME: ''
# MONGO_INITDB_ROOT_PASSWORD: ''
# MONGO_INITDB_DATABASE: ''
# networks:
# - my_api_template
redis:
image: redis
command: redis-server --appendonly yes # 开启redis数据持久化
ports:
- '6379:6379'
environment:
- TZ=Asia/Shanghai
networks:
- my_api_template
restart: on-failure # 自动重启
volumes:
- ./deploy/redis/db:/data # 把持久化数据挂载到宿主机
- ./deploy/redis/conf/redis.conf:/usr/local/etc/redis/redis.conf # 把redis的配置文件挂载到宿主机
- ./deploy/redis/logs:/logs # 用来存放日志
nestjs-app:
build:
context: .
dockerfile: Dockerfile
ports:
- '5151:5151'
restart: on-failure # 设置自动重启
env_file:
- ./prod.env
depends_on:
# - mongo
- redis
networks:
- my_api_template
networks:
my_api_template:
driver: bridge