Electron Release Server have Dockerfile
and docker-compose.yml
.
So, you can use docker and docker-compose.
Install docker and docker-compose.
$ docker-compose up -d
$ # open localhost:5000 in browser
If you use docker-machine you should change
APP_URL
at docker-compose.yml
to address to your docker-machine.
To run the single container provide the next environment variables:
APP_USERNAME
,APP_PASSWORD
– static username and password for authentication ref.DB_HOST
– hostname of postgresDB_PORT
– port of postgresDB_USERNAME
,DB_PASSWORD
– credentials to access postgresDB_NAME
– Database nameTOKEN_SECRET
– Recommended: 63 random alpha-numeric charactersAPP_URL
- base url for the app - ref
To use production.js
set NODE_ENV
to "production"
– so you should not set the environment variables:
APP_USERNAME
, APP_PASSWORD
, DB_HOST
, DB_PORT
,
DB_USERNAME
, DB_PASSWORD
, DB_NAME
, TOKEN_SECRET
.
Warning: You can insert the TOKEN_SECRET
, APP_PASSWORD
, DB_PASSWORD
directly into the docker-compose.yml
, but keep your secrets and private information in private. The production secrets must not be committed publicly!
Firstly you should start with development setting to run database migration.
After it you should always
run in production mode – set NODE_ENV
to "production"
.