Docktor is a platform for administrating and deploying SaaS services based on Docker.
456
Docktor is a platform for administrating and deploying SaaS services based on Docker.
Tools and dependencies:
Get the dependencies:
npm install
govendor sync
Run a MongoDB database:
docker run --name mongo -p 27017:27017 -v /data/mongo:/data/db -d mongo
Run a Redis cache:
docker run --name redis -p 6379:6379 -d redis
Docktor allows three ways of configuration:
~/.docktor.tomlserver.mongo.addr becomes MONGO_SERVER_MONGO_ADDR)--server.mongo.addr)You can see all the available settings and their defaults with:
go run main.go serve --help
Here is an example file:
env = "dev"
[server]
[server.mongo]
addr = "localhost:27017"
username = ""
password = ""
[server.redis]
addr = "localhost:6379"
password = ""
[auth]
jwt-secret = "a-unique-secret-for-secure-password-hosting"
reset-pwd-secret = "a-unique-secret-for-reset-password-token-generation"
bcrypt-pepper = "a-pepper-used-when-storing-password-to-db"
[smtp]
server = ""
user = ""
identity = ""
password = ""
sender = ""
[ldap]
address = ""
baseDN = ""
bindDN = ""
bindPassword = ""
searchFilter = ""
[ldap.attr]
username = ""
firstname = ""
lastname = ""
realname = ""
email = ""
Then, you can run Docktor in dev mode, with live reload, with the command:
npm start
You can then browse Docktor at http://localhost:8080/
It's possible to debug the docktor server using vscode and delve. In order to do that, just:
go get github.com/derekparker/delve/cmd/dlv
npm run client:start
Be careful, new endpoints will not be taken account until you restart the debugger
You can generate the binaries with:
npm run build
npm run package
Docktor is open to contribution.
Docktor have his own code guideline. Please install:
Run the following commands to check lint errors
# Get Gometalinter
go get -u github.com/alecthomas/gometalinter
# Run go lint (with gometalinter)
npm run server:lint
# Run eslint
npm run client:lint
If you need to lint inplace your Javascript files afterwards, run:
npm run client:fix
Updating dependencies regularly is important to fix bugs and use latest features.
# Run govendor to update every Golang dependency from remote packages.
govendor fetch +all
# Build the application to check that application still compiles
npm run build
Use of NPM-Check-Updates is strongly recommended.
# Install NPM Check Updates (aka ncu)
[sudo] npm install -g npm-check-updates
# List all updatable libraries
ncu
# Upgrade package.json with latest stable and comaptible versions
ncu -u
npm install
# Build the application to check that application is still working
# For dev
npm start
# For prod
npm run build
./docktor serve
To update dependencies with latest version (not necessarily compatible), use ncu -a
See the LICENSE file.
Content type
Image
Digest
Size
32.8 MB
Last updated
about 9 years ago
docker pull soprasteria/docktor