-
Notifications
You must be signed in to change notification settings - Fork 21
/
docker-compose.yml
76 lines (72 loc) · 1.81 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
65
66
67
68
69
70
71
72
73
74
75
76
services:
nestjs-auth-api:
container_name: nestjs-auth-api
image: nestjs-auth-api
restart: unless-stopped
build:
context: .
dockerfile: Dockerfile
target: development # Only will build development stage from our dockerfile
volumes:
- ./:/usr/src/app
ports:
- ${PORT}:${PORT}
networks:
- nestjs-auth-intranet
env_file:
- .env # Available inside container not in compose file
environment:
- DB_HOST=nestjs-auth-mysql
- REDIS_HOST=nestjs-auth-redis
depends_on:
nestjs-auth-mysql:
condition: service_healthy
nestjs-auth-redis:
condition: service_healthy
command: npm run start:dev # Run in development mode
nestjs-auth-mysql:
container_name: nestjs-auth-mysql
image: mysql:8.0
restart: unless-stopped
volumes:
- mysql:/var/lib/mysql
ports:
- 3307:${DB_PORT}
networks:
- nestjs-auth-intranet
environment:
MYSQL_ROOT_PASSWORD: ${DB_PASSWORD}
MYSQL_DATABASE: ${DB_NAME}
MYSQL_USER: ${DB_USER}
MYSQL_PASSWORD: ${DB_PASSWORD}
TZ: 'utc'
command: --default-authentication-plugin=mysql_native_password
healthcheck:
test: ['CMD', 'mysqladmin', '-u${DB_USER}', '-p${DB_PASSWORD}', 'ping']
interval: 5s
retries: 3
timeout: 3s
nestjs-auth-redis:
container_name: nestjs-auth-redis
image: redis:alpine
restart: unless-stopped
volumes:
- redis:/data
ports:
- 6380:${REDIS_PORT}
networks:
- nestjs-auth-intranet
healthcheck:
test: ['CMD', 'redis-cli', 'ping']
interval: 5s
retries: 3
timeout: 3s
volumes:
mysql:
name: nestjs-auth-mysql
redis:
name: nestjs-auth-redis
networks:
nestjs-auth-intranet:
name: nestjs-auth-intranet
driver: bridge