-
Notifications
You must be signed in to change notification settings - Fork 0
/
rundocker.sh
29 lines (25 loc) · 989 Bytes
/
rundocker.sh
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
# build the docker image from Dockerfile
# execute in parent directory
docker build -t matthiasstahl/verkstad_server .
# push it to a global registry
docker push matthiasstahl/verkstad_server
# run it on the target machine
docker run -it
-v "$(pwd)"/docker_volume/db:/app/db # adjust for location of db file
-v "$(pwd)"/docker_volume/log:/app/log # adjust for location of log file
-p 8081:8081 # adjust exposing port (first one)
--env-file .env # make your own env file (see below)
matthiasstahl/verkstad_server
# same line, but without \n and comments
docker run -it -v "$(pwd)"/docker_volume/db:/app/db -v "$(pwd)"/docker_volume/log:/app/log -p 8081:8081 --env-file .env matthiasstahl/verkstad_server
# env variables to define (with example values)
NODE_ENV='production'
PORT=8081
DB_HOST=localhost
DB_STORAGE=./db/verkstad.sqlite
DB_NAME=verkstad
DB_USER=root
DB_PASS=secret
DB_DIALECT=sqlite
JWT_SECRET=secret
LOG_PATH=./log