-
Notifications
You must be signed in to change notification settings - Fork 14
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
Add Docker Compose Deployment with MariaDB #188
Conversation
docker-compose.yml
Outdated
|
||
volumes: | ||
mariadb_data: | ||
src: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
here you are defining a volume named "src", which is not needed because this is not at all related to the "./src" volume defined for the application service.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you are right, I will remove it
src/qsts3/settings.py
Outdated
"ENGINE": "django.db.backends.sqlite3", | ||
"NAME": BASE_DIR / "db.sqlite3", | ||
} | ||
"default": { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The idea of 12factor is to have your application code constant and only change things based on environment variables. Here you are introducing conditional logic just for the sake of customizing the set up.
It is better to simply add different environment variables (and use sensible defaults) here and keep your application code the same:
DATABASES = {
"DATABASE_ENGINE": os.getenv("QSTS_DATABASE_ENGINE", "django.db.backends.mysql"),
"DATABASE_HOST": os.getenv("QSTS_DATABASE_HOST", "mariadb"),
"DATABASE_PORT": os.getenv("QSTS_DATABASE_PORT", 3306),
"DATABASE_USER": os.getenv("QSTS_DATABASE_USER", "qsts"),
"DATABASE_PASSWORD": os.getenv("QSTS_DATABASE_PASSWORD"),
}
|
Summary:
This PR adds a Docker Compose configuration to set up a MariaDB instance, replicating the Toolforge infrastructure for local development.
Changes:
ToDo: