add postgres config and dependencies

This commit is contained in:
Thomas Nahuel Rusiecki 2025-02-18 20:29:45 -03:00
parent 36fbb9bd76
commit e1c26db29f
3 changed files with 9 additions and 16 deletions

View file

@ -4,7 +4,6 @@ FROM python:3.11.7-slim-bookworm
RUN apt update && \
apt-get install -y \
git \
sqlite3 \
jq \
libpango-1.0-0 libpangoft2-1.0-0 \
&& pip install cffi brotli \

View file

@ -35,3 +35,4 @@ pyroaring==0.4.5
coverage==7.4.3
gunicorn==21.2.0
pyvckit
psycopg2-binary==2.9.10

View file

@ -121,22 +121,15 @@ WSGI_APPLICATION = 'trustchain_idhub.wsgi.application'
# Database
# https://docs.djangoproject.com/en/4.2/ref/settings/#databases
DATABASES = {
# 'default': {
# 'ENGINE': 'django.db.backends.sqlite3',
# 'NAME': BASE_DIR / 'db.sqlite3',
# }
'default': config(
'DATABASE_URL',
default='sqlite:///' + os.path.join(BASE_DIR, 'db.sqlite3'),
cast=db_url
)
# 'default': config(
# 'DATABASE_URL',
# default='sqlite:///' + os.path.join(BASE_DIR, 'db.sqlite3'),
# cast=db_url
# )
'default': {
'ENGINE': os.getenv('DB_ENGINE', 'django.db.backends.postgresql'),
'NAME': os.getenv('IDHUB_DB_NAME', 'idhub'),
'USER': os.getenv('IDHUB_DB_USER', 'ereuse'),
'PASSWORD': os.getenv('IDHUB_DB_PASSWORD', 'ereuse'),
'HOST': os.getenv('IDHUB_DB_HOS', 'idhub-postgres'),
'PORT': os.getenv('IDHUB_DB_PORT', '5432'),
}
}