From 22ecb9a611ac0e6c23d345c05cd34f4251097ec0 Mon Sep 17 00:00:00 2001 From: saani Date: Sun, 23 Nov 2025 15:40:46 +0000 Subject: [PATCH] config: switch to SQLite database and change application port to 8080 - Replace PostgreSQL with SQLite as default database backend - Comment out PostgreSQL configuration for potential future use - Update Docker exposed port from 8000 to 8080 - Update Gunicorn bind address to match new port This simplifies the deployment setup by removing the PostgreSQL dependency and aligns the application port with common alternatives to port 8000. --- booking_system/settings.py | 26 +++++++++++++------------- dockerfile | 4 ++-- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/booking_system/settings.py b/booking_system/settings.py index a10e927..bfd7ca3 100644 --- a/booking_system/settings.py +++ b/booking_system/settings.py @@ -72,24 +72,24 @@ TEMPLATES = [ WSGI_APPLICATION = 'booking_system.wsgi.application' -# DATABASES = { -# 'default': { -# 'ENGINE': 'django.db.backends.sqlite3', -# 'NAME': BASE_DIR / 'db.sqlite3', -# } -# } - DATABASES = { 'default': { - 'ENGINE': 'django.db.backends.postgresql', - 'NAME': os.getenv('POSTGRES_DB'), - 'USER': os.getenv('POSTGRES_USER'), - 'PASSWORD': os.getenv('POSTGRES_PASSWORD'), - 'HOST': os.getenv('POSTGRES_HOST', 'postgres'), - 'PORT': os.getenv('POSTGRES_PORT', 5432), + 'ENGINE': 'django.db.backends.sqlite3', + 'NAME': BASE_DIR / 'db.sqlite3', } } +# DATABASES = { +# 'default': { +# 'ENGINE': 'django.db.backends.postgresql', +# 'NAME': os.getenv('POSTGRES_DB'), +# 'USER': os.getenv('POSTGRES_USER'), +# 'PASSWORD': os.getenv('POSTGRES_PASSWORD'), +# 'HOST': os.getenv('POSTGRES_HOST', 'postgres'), +# 'PORT': os.getenv('POSTGRES_PORT', 5432), +# } +# } + ENCRYPTION_KEY = os.getenv('ENCRYPTION_KEY') diff --git a/dockerfile b/dockerfile index 6ffeffd..f234346 100644 --- a/dockerfile +++ b/dockerfile @@ -24,7 +24,7 @@ COPY . . RUN python manage.py collectstatic --noinput # Expose port -EXPOSE 8000 +EXPOSE 8080 # Run migrations and start Gunicorn -CMD sh -c "python manage.py migrate && gunicorn booking_system.wsgi:application --bind 0.0.0.0:8000 --workers 3" \ No newline at end of file +CMD sh -c "python manage.py migrate && gunicorn booking_system.wsgi:application --bind 0.0.0.0:8080 --workers 3" \ No newline at end of file -- 2.39.5