From 8eef93ba0b0cce4a6a54afee8f0fb17273d0cb66 Mon Sep 17 00:00:00 2001 From: kaan Date: Sat, 23 Nov 2024 19:33:24 +0300 Subject: [PATCH] giving environment variables --- backend/app/migrations/0001_initial.py | 3 +-- .../0002_remove_questionprogress_user.py | 17 ----------------- docker-compose-dev-backend.yml | 8 ++++---- 3 files changed, 5 insertions(+), 23 deletions(-) delete mode 100644 backend/app/migrations/0002_remove_questionprogress_user.py diff --git a/backend/app/migrations/0001_initial.py b/backend/app/migrations/0001_initial.py index cbcdff1f..a8b173bf 100644 --- a/backend/app/migrations/0001_initial.py +++ b/backend/app/migrations/0001_initial.py @@ -1,4 +1,4 @@ -# Generated by Django 4.2.16 on 2024-11-23 14:38 +# Generated by Django 4.2.16 on 2024-11-23 16:15 from django.conf import settings import django.contrib.postgres.fields @@ -166,7 +166,6 @@ class Migration(migrations.Migration): ('time_taken', models.IntegerField(default=0)), ('question', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='progress', to='app.question')), ('quiz_progress', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='question_progress', to='app.quizprogress')), - ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='question_progress', to=settings.AUTH_USER_MODEL)), ], options={ 'unique_together': {('question', 'quiz_progress')}, diff --git a/backend/app/migrations/0002_remove_questionprogress_user.py b/backend/app/migrations/0002_remove_questionprogress_user.py deleted file mode 100644 index a172078a..00000000 --- a/backend/app/migrations/0002_remove_questionprogress_user.py +++ /dev/null @@ -1,17 +0,0 @@ -# Generated by Django 4.2.16 on 2024-11-23 14:42 - -from django.db import migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ('app', '0001_initial'), - ] - - operations = [ - migrations.RemoveField( - model_name='questionprogress', - name='user', - ), - ] diff --git a/docker-compose-dev-backend.yml b/docker-compose-dev-backend.yml index 7c8c02a5..37cc1e9c 100644 --- a/docker-compose-dev-backend.yml +++ b/docker-compose-dev-backend.yml @@ -4,15 +4,15 @@ services: container_name: postgres_db restart: always environment: - POSTGRES_DB: db - POSTGRES_USER: halil - POSTGRES_PASSWORD: 123 + POSTGRES_DB: ${DB_NAME} + POSTGRES_USER: ${DB_USER} + POSTGRES_PASSWORD: ${DB_PASSWORD} volumes: - ./dbdata:/var/lib/postgresql/data ports: - "5432:5432" healthcheck: - test: ["CMD-SHELL", "pg_isready -U halil -d db"] + test: ["CMD-SHELL", "pg_isready -U ${DB_USER} -d ${DB_NAME}"] interval: 5s timeout: 10s retries: 5