-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
37 lines (32 loc) · 1.28 KB
/
docker-compose.yml
File metadata and controls
37 lines (32 loc) · 1.28 KB
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
version: '3'
services:
app:
build: .
volumes:
- ./:/app/src # /app will be our deployment directory and has additional files
# created during `docker build` (such as node_modules)
# /app/src is where we mount the source and will run it
environment:
- TZ=Asia/Kolkata
ports:
- 8000:8000 # expose port 8000. The script will output its local ip when run,
# and you can access the running web-app at ip:8000
depends_on:
- mysql
command: bash -c "cd ./src && ../wait-for-it.sh -t 180 mysql:3306 -- nodemon server_script.js"
# This waits for mysql server to start listening on default port
# (with a timeout) before we run nodemon
# The above is a little ugly. bash -c is needed because o/w we can't use `cd`
# We have to use cd because o/w relative paths don't work correctly
mysql:
image: mysql:8
volumes:
- ./schema:/docker-entrypoint-initdb.d # mount initial schema
- mysql-data:/var/lib/mysql # persist data
environment:
- TZ=Asia/Kolkata
- MYSQL_ROOT_PASSWORD=password # just because mysql complains if this isn't set
expose:
- 3306
volumes:
mysql-data: