forked from o1lab/xmysql
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
42 lines (37 loc) · 859 Bytes
/
docker-compose.yml
File metadata and controls
42 lines (37 loc) · 859 Bytes
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
version: '3.5'
services:
db:
image: mysql:5.7
restart: always
command: --init-file /docker-entrypoint-initdb.d/sample.sql
environment:
MYSQL_ROOT_PASSWORD: 'pass'
MYSQL_USER: 'root'
MYSQL_PASSWORD: 'pass'
MYSQL_DATABASE: 'classicmodels'
volumes:
- ./tests/docker-sample.sql:/docker-entrypoint-initdb.d/sample.sql
- db-data:/var/lib/mysql
ports:
- "3306:3306"
db-api: &db-api
build:
context: ./
dockerfile: ./dev.Dockerfile
environment:
DATABASE_HOST: 'db'
DATABASE_USER: 'root'
DATABASE_PASSWORD: 'pass'
DATABASE_NAME: 'classicmodels'
ports:
- "3002:80"
depends_on:
- db
test:
<<: *db-api
command: sh -c "npm test"
volumes:
- ./tests:/usr/src/app/tests
- ./lib:/usr/src/app/lib
volumes:
db-data: