Skip to content

Commit

Permalink
docker: adding envvars to docker local_settings to allow the configur…
Browse files Browse the repository at this point in the history
…ation of the database
  • Loading branch information
lanathlor authored and pevma committed Apr 13, 2024
1 parent 81b00b4 commit 28608c8
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions docker/scirius/scirius/local_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,24 @@
if '127.0.0.1' not in ALLOWED_HOSTS:
ALLOWED_HOSTS.append('127.0.0.1')

DATABASE_ENGINE = "django.db.backends." + ("postgresql_psycopg2" if os.getenv('DATABASE_TYPE', 'sqlite3') == "pg" else "sqlite3")
DATABASE_NAME = os.getenv('DATABASE_NAME', 'db.sqlite3')
DATABASE_USER = os.getenv('DATABASE_USERNAME', '')
DATABASE_PASSWORD = os.getenv('DATABASE_PASSWORD', '')
DATABASE_HOST = os.getenv('DATABASE_HOST', '')
DATABASE_PORT = os.getenv('DATABASE_PORT', '')


# Database
DATABASES = {
'default': {
'ENGINE': os.getenv('SQL_ENGINE', 'django.db.backends.sqlite3'),
'NAME': os.getenv('SQL_DATABASE', '/data/scirius.sqlite3')
'ENGINE': DATABASE_ENGINE,
'NAME': DATABASE_NAME,
'USER': DATABASE_USER,
'PASSWORD': DATABASE_PASSWORD,
'HOST': DATABASE_HOST,
'PORT': DATABASE_PORT,

}
}

Expand Down

0 comments on commit 28608c8

Please sign in to comment.