J3RN / time-tracker

A time tracking application
http://timesheet.j3rn.com
MIT License
6 stars 14 forks source link

'Ability to run locally with docker' #113

Closed smacz42 closed 5 years ago

smacz42 commented 7 years ago

This setup has two docker containers to maximize scalability. This is because one of the images is the web frontend and the other is the database (postgresql) backend. This would be the logical architecture if one were to deploy this over many datacenters, etc. This setup requires ... setup though.

git clone *repo* && cd *repo*
docker-compose build
docker-compose run web rake db:setup
docker-compose up

After the last step, the output from the containers are piped to stdout, and killing the output kills the process. This setup is more geared towards the developer and QA, etc. Also, be careful as this does drop a log file and a tmp directory from passenger into the $PWD - that behavior can be changed if necessary.

There is also another approach to dockerize the image, where it is one image. This is considerably easier on the end users to setup and run, and does not require any setup. However, it is completely transparent when it comes to the nuts and bolts, with the most being able to be specified would be the port that it was bound to on localhost. In essence it would just run. That type of image would also be more appropriate to showcase on a "downloads" page for this app.

Let me know if you want one or the other or both. I'll probably have a second branch for the single version later. I wonder what they use at CMM...

EDIT: What directory would you want to expose to the host filesystem? This is in order to backup user data.

smacz42 commented 7 years ago

RE: TravisCI - specifying the hostname in the config/databases file is necessary. Let me know your thoughts. Got it to pass

EDIT: For my own reference: https://github.com/kanboard/kanboard puts various files that need to be amended into a separate "docker" folder in the project's root dir. Then they are able to be copied one-by-one into the image, overwriting the other files.

smacz42 commented 7 years ago

Write-up here if you've got any conceptual questions.