lofocats_api icon indicating copy to clipboard operation
lofocats_api copied to clipboard

Work toward being Cloud Native and support Docker

Open maxbrunet opened this issue 5 years ago • 1 comments

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

maxbrunet avatar Mar 12 '19 21:03 maxbrunet

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 :+1:

iridakos avatar Apr 25 '19 16:04 iridakos