renaming vars

This commit is contained in:
Thomas Nahuel Rusiecki 2025-02-02 02:23:35 -03:00
parent 39ab636154
commit 2064929845
4 changed files with 20 additions and 24 deletions

View file

@ -72,12 +72,10 @@ IDHUB_ENABLE_2FACTOR_AUTH=false
IDHUB_ENABLE_DOMAIN_CHECKER=false IDHUB_ENABLE_DOMAIN_CHECKER=false
IDHUB_PREDEFINED_TOKEN='27f944ce-3d58-4f48-b068-e4aa95f97c95' IDHUB_PREDEFINED_TOKEN='27f944ce-3d58-4f48-b068-e4aa95f97c95'
#POSTGRES VARS #POSTGRES VARS
DB_NAME="devicehub" DB_NAME="devicehub"
DB_USER="ereuse" DB_USER="ereuse"
DB_PASSWORD="ereuse" DB_PASSWORD="ereuse"
DB_DOMAIN=localhost DB_HOST=localhost
DB_PORT=8000 DB_PORT=5432

View file

@ -136,9 +136,9 @@ DATABASES = {
'default': { 'default': {
'ENGINE': os.getenv('DB_ENGINE', 'django.db.backends.postgresql'), 'ENGINE': os.getenv('DB_ENGINE', 'django.db.backends.postgresql'),
'NAME': os.getenv('DB_NAME', 'devicehub'), 'NAME': os.getenv('DB_NAME', 'devicehub'),
'USER': os.getenv('DB_USER', 'devicehub'), 'USER': os.getenv('DB_USER', 'ereuse'),
'PASSWORD': os.getenv('DB_PASSWORD', 'devicehub'), 'PASSWORD': os.getenv('DB_PASSWORD', 'ereuse'),
'HOST': os.getenv('DB_HOST', 'postgres'), 'HOST': os.getenv('DB_HOST', 'devicehub-postgres'),
'PORT': os.getenv('DB_PORT', '5432'), 'PORT': os.getenv('DB_PORT', '5432'),
} }
} }

View file

@ -21,24 +21,18 @@ services:
ports: ports:
- ${DEVICEHUB_PORT:-8000}:${DEVICEHUB_PORT:-8000} - ${DEVICEHUB_PORT:-8000}:${DEVICEHUB_PORT:-8000}
depends_on: depends_on:
- postgres - devicehub-postgres
devicehub-postgres: devicehub-postgres:
image: postgres:17 image: postgres:17
environment: environment:
- DB_NAME=${DB_NAME:-devicehub} - POSTGRES_DB=${DB_NAME}
- db_USER=${DB_USER:-devicehub} - POSTGRES_USER=${DB_USER}
- db_PASSWORD=${DB_PASSWORD:-devicehub} - POSTGRES_PASSWORD=${DB_PASSWORD}
volumes: volumes:
- pg_data:/var/lib/postgresql/data - pg_data:/var/lib/postgresql/data
ports: #ports:
- ${DB_PORT}:${DB_PORT} # - ${DB_PORT}:${DB_PORT}
volumes:
pg_data:
# TODO add database service for idhub, meanwhile sqlite # TODO add database service for idhub, meanwhile sqlite
@ -76,3 +70,6 @@ volumes:
- 9001:9001 - 9001:9001
# TODO add database service for idhub, meanwhile sqlite # TODO add database service for idhub, meanwhile sqlite
volumes:
pg_data:

View file

@ -6,6 +6,7 @@ set -u
set -x set -x
program_dir='/opt/devicehub-django' program_dir='/opt/devicehub-django'
#source .env
. "${program_dir}/.env" . "${program_dir}/.env"
wait_for_postgres() { wait_for_postgres() {
@ -45,11 +46,11 @@ gen_env_vars() {
ADMIN='True' ADMIN='True'
PREDEFINED_TOKEN="${PREDEFINED_TOKEN:-}" PREDEFINED_TOKEN="${PREDEFINED_TOKEN:-}"
DB_NAME=${DB_NAME:-devicehub} DB_NAME="${DB_NAME:-devicehub}"
DB_USER=${DB_USER:-ereuse} DB_USER="${DB_USER:-ereuse}"
DB_PASSWORD=${DB_PASSWORD:-ereuse} DB_PASSWORD="${DB_PASSWORD:-ereuse}"
DB_HOST=${DB_HOST:-localhost} DB_HOST="${DB_HOST:-localhost}"
DB_PORT=${DB_PORT:-5432} DB_PORT="${DB_PORT:-5432}"
# specific dpp env vars # specific dpp env vars
if [ "${DPP:-}" = 'true' ]; then if [ "${DPP:-}" = 'true' ]; then