-
Notifications
You must be signed in to change notification settings - Fork 681
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve the docker build to use the release configuration and allow splitting off the database/web front end to allow scaling #96
Comments
Hey there! BaGet's Docker integration could definitely use some love. BaGet's Docker image is pretty much unusable for production environments.
This would be awesome.
BaGet creates its database at startup if it is run debug mode (see this). Today, the Docker image uses this feature to create its database. This is an ugly hack that should be removed. Instead, the database should be created when the container is created.
The tests are run on each commit by the Travis CI configuration. Is the idea to run the tests while creating the docker image? If so, what are the added benefits to doing this?
That'd be great! I'm no Docker expert and I'd appreciate any help 😄 |
Ok, what database do we want to use in development, I'm assuming people will be running on .net core, therefore I'd suggest either PostGres or sql server on Linux, with a preference to the former! The idea is definitely to run tests during Docke image creation, it means hat local and CI ae in step with each other--currently you are assuming the tests have been run locally, which in my view is a bad idea! Once we've decided on a database, I'll start creating docker files. We will have 3 containers locally, one for the database, one for the API and one for the frontend. |
BaGet has been ported to SQL Server and SQLite, so we should stick to those. For now, I recommend using SQLite for development and SQL Server for production. I'm definitely open to porting BaGet to more database engines though! 😄
You can create the database manually by following these steps:
|
I will soon create a docker image which uses published release configuration. The backend database type will be indicated by environment variable. By default it will be sqlite. |
Having just looked at the dockerfile, I wondered whether there was a reason why it built BaGet using the debug configuration.
Also, is there a reason tests aren't run during build?
Finally, it would be nice to split the web frontend and database in to separate containers using docker compose for scalability.
Happy to submit pr's to do this.
The text was updated successfully, but these errors were encountered: