Closed alex-stout closed 5 years ago
Just updated to add persistence to the databases. Now on initial startup, volumes will be mounted to api/data-volumes
which will contain the data for both the SQL and NoSQL database. This allows for the services to be shutdown and re-run without data loss.
@alex-stout Should exclude the package-lock file from this set of changes.
@battlecow I've removed the package-lock
file from the change list. I've also added a Dockerfile
and .dockerignore
for the app itself (not the services).
My thought here is if we are going to include a Dockerfile we should at a minimum run it as non-root user since node is added upstream. Added a gist of my thoughts: https://gist.github.com/battlecow/7d98a64088e9ed3a2fb9283700a19fea If the container is meant for dev the NODE_ENV could be removed, wasn't really sure if the intent is to use it for prod or dev.
Updated to run as non-root user. I kept in NODE_ENV = "development"
to be explicit that this is meant for development only. If this Docker configuration is deemed "production" ready, that could be changed. Thank you for the input, that helps a lot.
This PR eases the burden of installation of the key services using Docker.
Here is the itemized list of changes:
docker-compose.yml
file into the/api
folder..env
file when placed in the root of the project./api/init_sql/
directory with thescout.sql
script in there.installer.rb
to ask if the user is using a Docker install for local development. If so, it doesn't go through the steps of asking them for the SQL and NoSQL configuration questions..env
file. You'll notice thedocker-compose.yml
file references them. This is handy so you don't have to rename the variables to fit into the required naming convention of the Docker images.In the future I will add Dockerization for the production install. There's going to have to be a discussion on whether or not that is something that should be done. There's more to consider with this approach for that use case.
Note: I wasn't able to find the issue reference for this.