rok-cesnovar / cloudstan-experiment

My repo for experimenting with cloudstan
MIT License
0 stars 0 forks source link

My experiment on cloudstan

This is just an experiment on cloudstan I threw together in about 2 days time. Any suggestions, comments, issues, etc. are very welcome.

This is built using

(17.7.2019) The web app support logging in with your Github account but I switched it off for the time being as there were issues with the callback URL when migrating to Heroku.

Usage

Set the appropriate environment variables that are listed in .env.example and then run the following:

git clone 
cd 
npm install
cp .env.example .env
npm start

Docker

The docker development hasnt been tested fully. Proceed with caution.

You can also use docker for development. Make sure you run npm install on your host machine so that code linting and everything works fine.

npm i
cp .env.example .env

Start the services

docker-compose up -d

View the logs

docker-compose logs -f

In case you install a npm module while developing, it should also be installed within docker container, to do this first install the module you want with simple npm i module name, then run it within docker container

docker-compose exec node npm i

If you make any changes to the file, nodemon should automatically pick up and restart within docker (you can see this in the logs)

To run tests

docker-compose exec -e MONGODB_URL=mongodb://mongo:27017/noobjs_test node npm test

Note that we are overriding the environment variable set in .env file because we don't want our data erased by the tests.

Note: The difference between exec and run is that, exec executes the command within the running container and run will spin up a new container to run that command. So if you want to run only the tests without docker-compose up, you may do so by running docker-compose run -e MONGODB_URL=mongodb://mongo:27017/my_app_test node npm test

License

MIT