-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
63 lines (58 loc) · 1.36 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
version: '2.1'
x-env:
&env_variables
environment:
- DB_HOST=mysql
- API_URL=http://localhost:8081
- WEB_URL=http://localhost:4200
- DB_USERNAME=root
- DB_PASSWORD=root
- DB_PORT=3306
- PORT=8081
- TZ=UTC
- ADMIN_EMAIL=gracetrees@gmail.com
services:
mysql:
image: mysql:5.7
container_name: mysql
restart: always
environment:
MYSQL_DATABASE: 'grace_tree_db'
MYSQL_USER: 'root'
MYSQL_PASSWORD: 'root'
MYSQL_ROOT_PASSWORD: 'root'
ports:
- '3304:3306'
expose:
- '3306'
volumes:
- my-db:/var/lib/mysql
# Solves the Incorrect date value issue
command: --sql_mode="NO_ENGINE_SUBSTITUTION"
grace-tree-server:
image: betaquick/grace-tree-server:latest
# Wait for mysql to be up before starting the server
command: bash -c "./wait-for-it.sh mysql:3306 -- npm start"
build:
context: .
dockerfile: Dockerfile
<<: *env_variables
ports:
- '8081:8081'
expose:
- '8081'
depends_on:
- mysql
links:
- mysql
migrate:
image: betaquick/grace-tree-server:latest
# Wait for mysql to be up before migrating and seeding database
command: bash -c "./wait-for-it.sh mysql:3306 -- npm run migrate && npm run seed"
<<: *env_variables
links:
- mysql
depends_on:
- mysql
volumes:
my-db: