-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
46 lines (45 loc) · 1.01 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
version: '3.6'
services:
api:
build: .
image: final-api
restart: always
ports:
- 8000:8000
environment:
MYSQL_DATABASE: ${MYSQL_DATABASE}
MYSQL_USER: ${MYSQL_USER}
MYSQL_PASSWORD: ${MYSQL_PASSWORD}
MYSQL_HOST: mysql
MYSQL_PORT: 3306
depends_on:
- "mysql"
- "mongo"
mysql:
image: mysql:5
restart: always
volumes:
- mysql-data:/var/lib/mysql
- ./db-init:/docker-entrypoint-initdb.d
environment:
MYSQL_RANDOM_ROOT_PASSWORD: 'yes'
MYSQL_DATABASE: ${MYSQL_DATABASE}
MYSQL_USER: ${MYSQL_USER}
MYSQL_PASSWORD: ${MYSQL_PASSWORD}
mongo:
image: mongo:latest
restart: always
volumes:
- mongo-data:/data/db
- ./db-init/:/docker-entrypoint-initdb.d/
environment:
MONGO_INITDB_DATABASE: users
MONGO_INITDB_ROOT_USERNAME: root
MONGO_INITDB_ROOT_PASSWORD: admin
ports:
- 27017:27017
volumes:
mysql-data:
name: mysql-data
mongo-data:
name: users-mongo-data