This repository has been archived by the owner on Dec 5, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
54 lines (51 loc) · 1.92 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
version: '3'
services:
api:
build:
context: .
args:
- NODE_ENV=development
command: ts-node-dev --respawn --transpileOnly ./src/index.ts
ports:
- "3000:3000"
volumes:
- .:/opt/node_app/app:delegated
# bind-mounting these two files in will let you add packages during development without rebuilding
# for example, to add bower to your app while developing, just install it inside the container
# and then nodemon will restart. Your changes will last until you "docker-compose down" and will
# be saved on host for next build
# NOTE: this won't work on Docker Toolbox (virtualbox) which doesn't bind-mount single files
# docker-compose exec api npm install --save bower
- ./package.json:/opt/node_app/package.json
- ./package-lock.json:/opt/node_app/package-lock.json
# this is a workaround to prevent host node_modules from accidently getting mounted in container
# in case you want to use node/npm both outside container for test/lint etc. and also inside container
# this will overwrite the default node_modules dir in container so it won't conflict with our
# /opt/node_app/node_modules location. Thanks to PR from @brnluiz
- notused:/opt/node_app/app/node_modules
environment:
- NODE_ENV=development
- TYPEORM_CONNECTION=mysql
- TYPEORM_HOST=db
- TYPEORM_USERNAME=test
- TYPEORM_PASSWORD=test
- TYPEORM_DATABASE=test
- TYPEORM_PORT=3306
- TYPEORM_SYNCHRONIZE=true
- TYPEORM_LOGGING=false
- TYPEORM_ENTITIES=src/entity/**/*.ts
- TYPEORM_MIGRATIONS=src/migration/**/*.ts
- TYPEORM_SUBSCRIBERS=src/subscriber/**/*.ts
depends_on:
- db
db:
image: "mysql:5.7"
ports:
- "3306:3306"
environment:
MYSQL_ROOT_PASSWORD: "admin"
MYSQL_USER: "test"
MYSQL_PASSWORD: "test"
MYSQL_DATABASE: "test"
volumes:
notused: