forked from alisd23/mikro-orm-issues
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yaml
82 lines (72 loc) · 1.78 KB
/
docker-compose.yaml
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
77
78
79
80
81
82
version: "3.3"
# Configure services
services:
#==========================================#
# DATABASE STUFF #
#==========================================#
# MySQL image for local testing
sql:
image: mysql:5.7
environment:
MYSQL_ROOT_PASSWORD: test
MYSQL_DATABASE: core
#===================================#
# COMMANDS #
#===================================#
base-command: &base-command
image: node:lts-slim
tty: true
environment:
SQL_HOST: sql
SQL_PORT: 3306
SQL_USERNAME: root
SQL_PASSWORD: test
SQL_DATABASE_NAME: core
depends_on:
- sql
working_dir: /app
volumes:
- "./:/app"
# Run migrations to latest version
migration-up:
<<: *base-command
entrypoint: bash
command: >-
./scripts/wait-for-it.sh sql:3306 -s --
yarn start:dev
migration-down:
<<: *base-command
entrypoint: bash
command: >-
./scripts/wait-for-it.sh sql:3306 -s --
yarn mikro-orm migration:down
# Create new migration from schema diff
migration-create:
<<: *base-command
entrypoint: bash
command: >-
./scripts/wait-for-it.sh sql:3306 -s --
yarn mikro-orm migration:create
# Start server
start-dev:
<<: *base-command
entrypoint: bash
command: >-
./scripts/wait-for-it.sh sql:3306 -s --
yarn nest start --watch
# Test
test:
<<: *base-command
entrypoint: bash
command: >-
./scripts/wait-for-it.sh sql:3306 -s --
yarn jest --run-in-band
# Test watch
test-watch:
<<: *base-command
entrypoint: bash
tty: true
stdin_open: true
command: >-
./scripts/wait-for-it.sh sql:3306 -s --
yarn jest --run-in-band --watchAll