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 && \ RUN apt update && \
apt-get install -y \ apt-get install -y \
git \ git \
sqlite3 \
jq \ jq \
libpango-1.0-0 libpangoft2-1.0-0 \ libpango-1.0-0 libpangoft2-1.0-0 \
&& pip install cffi brotli \ && pip install cffi brotli \

View file

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

View file

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