IMPORTANT
This repo is generated by build script, only for release purpose, don't checkout and change
This docker image includes BitSky Supplier and BitSky UI.
This docker image expose 9099
port.
All
TYPEORM_
are for typeorm, you can find all the environment variables from Using environment variables. For now, only tested with environemnt variables list in below, if you use other environment variables, you take your own risk
-
TYPEORM_CONNECTION
: Optional. Database connection type. Currently, available values [sqlite
,mongodb
]. Default will usesqlite
. -
TYPEORM_DATABASE
: Optional/Reuired. Database name. Required when yourTYPEORM_CONNECTION
isn'tsqlite
.For the sqlite, if you want to persist your data after docker container was killed, you can add a volumn when start docker, and configure the absolute path. For example, you did
docker -v /host/shared:/mnt/shared
, then you can configure this value/mnt/shared/bitsky.sql
. -
TYPEORM_HOST
: Optional/Reuired. Database host. Required when yourTYPEORM_CONNECTION
isn'tsqlite
. Example:bitsky123.mlab.com
-
TYPEORM_PORT
: Optional/Reuired. Database host port. Required when yourTYPEORM_CONNECTION
isn'tsqlite
. Example:27017
-
TYPEORM_USERNAME
: Optional. Database username. Example:dbuser
-
TYPEORM_PASSWORD
: Optional. Database password. Example:welcome
-
PORT
: Optional. Port number for this example server. Default value is9099
, when you run it in docker mode, you can map host port to9099
-
LOG_FILES_PATH
: Optional. The folder path that store log files -
LOG_LEVEL
: Optional. The log level, default isinfo
. Get more from winston logging levels -
LOG_MAX_SIZE
: Optional. The max size of log files. Default is50*1024*1024
(50MB), get more information from Winston File Transport - maxsize -
TASK_TIMEOUT_CHECK_TIME
: Optional. How frequently to check whether Tasks are timeout. Default is60000
ms. -
TIMEOUT_VALUE_FOR_TASK
: Optional. Timeout value for a Task. Default300000
ms -
RETAILER_STATE_CHECK_TIME
: Optional. How frequently to check Retailer state. Default10000
ms
If you want to run it local, make sure you already installed NodeJS and Yarn.
- Install node_modules.
npm install
- Start server
It start a server on local, you can access it http://localhost:9099
npm start
You also can change Environment Variables
Here are some example snippets to help you get started creating a container
Follow examples will start server use port
number 9101
, so after start successfully, you can access server by visit http://localhost:9101
docker run -p -d 9101:9099 bitskyai/web-app
This will use SQLite
if you close docker container, then database file also will be deleted
docker run -it -d \
-v /Users/neo/Downloads/bitsky-web-app:/usr/webapp \
-e LOG_FILES_PATH=/usr/webapp/log \
-e TYPEORM_CONNECTION=sqlite \
-e TYPEORM_DATABASE=/usr/webapp/bitsky.sql \
-p 9101:9099 bitskyai/web-app
/Users/neo/Downloads/bitsky-web-app
: The name of the volume, and is unique on a given host machine
Find detail of the environment values from Add or modify Environment Variables.
docker run -d -v /Users/neo/Downloads/bitsky-web-app:/usr/webapp \
-e LOG_FILES_PATH=/usr/webapp/log \
-e TYPEORM_CONNECTION=mongodb \
-e TYPEORM_HOST=ds163410.mlab.com \
-e TYPEORM_DATABASE=bitsky \
-e TYPEORM_PORT=12345 \
-e TYPEORM_USERNAME=admin \
-e TYPEORM_PASSWORD=welcome*123 \
-p 9101:9099 \
bitskyai/web-app
or
docker run -d \
-v /Users/neo/Downloads/bitsky-web-app:/usr/webapp \
-e LOG_FILES_PATH=/usr/webapp/log \
-e TYPEORM_CONNECTION=mongodb \
-e TYPEORM_URL=mongodb://admin:welcome*123@ds123456.mlab.com:12345/bitsky \
-p 9101:9099 \
bitskyai/web-app
This is an example of connect to mlab.com, make sure you change TYPEORM_HOST
, TYPEORM_DATABASE
, TYPEORM_PORT
, TYPEORM_USERNAME
, TYPEORM_PASSWORD
, or TYPEORM_URL
and port
mapping
You can simply deploy this example to Heroku by click this button: