-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
58 lines (53 loc) · 1.22 KB
/
docker-compose.yml
File metadata and controls
58 lines (53 loc) · 1.22 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
version: '3'
services:
nest:
container_name: backend
image: nest
build:
context: .
dockerfile: Dockerfile
ports:
- "8080:8080"
depends_on:
- db
environment:
- DB_HOST=${DB_HOST}
- DB_PORT=${DB_PORT}
- DB_USER=${DB_USER}
- DB_PASSWORD=${DB_PASSWORD}
- DB_NAME=${DB_NAME}
volumes:
- .:/usr/src/app
- /usr/src/app/node_modules
command: ["/usr/wait-for-it.sh", "db:3306", "--", "npm", "start"]
db:
container_name: db
image: mysql:8.0
command: --default-authentication-plugin=mysql_native_password
env_file:
- .env
environment:
- MYSQL_DATABASE=${DB_NAME}
- MYSQL_USER=${DB_USER}
- MYSQL_PASSWORD=${DB_PASSWORD}
- MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD}
volumes:
- db-data:/var/lib/mysql
- ./my.cnf:/etc/mysql/my.cnf
ports:
- 3306:3306
redis:
container_name: carrotRedis
image: redis:alpine
command: redis-server --requirepass ${REDIS_PASSWORD} --appendonly yes
hostname: ${REDIS_HOST}
labels:
- "name=redis"
- "mode=standalone"
ports:
- "6379:6379"
volumes:
- redis-data:/data
volumes:
db-data:
redis-data: