Note: launch reliable-mysql
service and seed data via npm run db:seed:all
first.
If you don't seed data the server will return 500 error.
available environment variable
$ docker run --rm --name reliable-web \
-p 9900:9900 \
-e RELIABLE_HOST=127.0.0.1 \
-e MYSQL_HOST=reliable-mysql \
--link reliable-mysql:reliable-mysql \
macacajs/reliable-web:v2
run as a service
$ docker run --name reliable-web \
-p 9900:9900 \
-e RELIABLE_HOST=127.0.0.1 \
-e MYSQL_HOST=reliable-mysql \
--link reliable-mysql:mysql-host \
-d macacajs/reliable-web:v2
if you want another hostname, please replace the 127.0.0.1
Just for developer
$ cd ${PROJECT_ROOT_PATH}
$ docker build --no-cache --pull -t macacajs/reliable-web .
$ docker push macacajs/reliable-web
start mysql:
# start
$ docker run --rm --name reliable-mysql \
-p 3306:3306 \
-v $HOME/reliable_home/mysql_data:/var/lib/mysql \
-d macacajs/reliable-mysql
# stop
$ docker stop reliable-mysql
start server:
npm run dev
# open app at localhost:7001
insert seed data:
npm run db:seed:all
remove seed data:
npm run db:seed:undo:all
npm test # test migration then test web server
npm run test-local # only test web server
npm run cov # test and output test coverage
variable name | description | default value |
---|---|---|
MYSQL_HOST | mysql server ip | 127.0.0.1 |
MYSQL_PORT | mysql port | 3306 |
RELIABLE_HOST | used for notification message template | 127.0.0.1 |