coderxio / dailymed-api

REST API for DailyMed SPLs
https://coderx.io/
MIT License
12 stars 5 forks source link

Yevgeny/docker basic #33

Closed yevgenybulochnik closed 4 years ago

yevgenybulochnik commented 4 years ago

Explanation

This PR adds initial support for using docker in both dev and prod env. It sticks to using sqlite for now but can be adjusted in the future. For prod the container is run as www-data user but stays with root for dev. When running in production appropriate permissions will need to be set for the repo itself and for the static assets. Pagination has also been added in this PR with appropriate adjustments for tests. Shout out to @finish06 for figuring out a solution for running the container with different users. The docker settings will likely continue to evolve but I think this serves as a decent base.

Rationale

There are many advantages to using docker for both prod and dev environments. One is to "contain" dependencies in isolated systems. This ensures every contributor is running code on the same system. Docker allows us to create easier deployment workflows.

Tests

  1. What testing did you do?

    • docker-compose up stands everything up for dev
    • docker-compose -f docker-compose.prod.yml up stands everything up for prod assuming permissions have been set
  2. Attach testing logs inside a summary block:

testing logs ``` ```