Skip to content

Work toward being Cloud Native and support Docker#2

Open
maxbrunet wants to merge 9 commits into
iridakos:masterfrom
maxbrunet:feature/cloud-native+docker
Open

Work toward being Cloud Native and support Docker#2
maxbrunet wants to merge 9 commits into
iridakos:masterfrom
maxbrunet:feature/cloud-native+docker

Conversation

@maxbrunet

@maxbrunet maxbrunet commented Mar 12, 2019

Copy link
Copy Markdown

Hi @iridakos,

I was looking for a small and simple app to make my own demo of running an app on a Cloud provider and I chose yours.

I don't know if you accept contributions or still maintain this project, but I did some work to make this application more "Cloud native" and to support Docker:

  • Add Dockerfile:
    • postgresql-client is only required by wait-for-postgres.sh (feel free to rewrite it in Ruby if you want to).
    • the container can be run as daemon (UID 2) instead of root
  • Add docker-compose.yml for development:
    • Mount bind the working directory, so your changes are directly available to the container when developing
    • The migrations are run when going up and then exit (can be restarted on demand)
  • Accept configuration from environment variables
  • Send logs to SDTOUT
  • Add basic health and metrics endpoints
  • Replace SQLite by PostgreSQL, so multiple replicas can use the same DB (db/schema.rb was updated automatically)
  • Fix test suite (mainly for PostgreSQL)
  • Add docker-compose.test.yml to create an isolated test environment (usable with Docker Hub Autotest feature)

I'm not a Ruby/Rails developer, so some changes might be raw, but I'm open to feedback.

Cheers,
Max

* Add Dockerfile
* Change database to PostgreSQL from SQLite
* Add docker-compose.yml to the development worklow
* Support configuration via environment variables
Fixes error when running `rspec`
`NoMethodError: undefined method `last_comment'`

See rspec/rspec-core@8e723fc
Related to change from SQLite to PostgreSQL
IDs do not always start at 1, change to just match digits.
... instead of the local directory.
These volumes actually persist after doing `down`.
`-v` needs to be specified to remove them.
@iridakos

Copy link
Copy Markdown
Owner

Hi @maxbrunet and thank you very much for contributing! It's been a while since the last time I wrote code for this repo but it's of course open for contributions!

I will check the pull request and merge it as soon as possible!

Thank you 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants