Skip to content

Commit

Permalink
Merge pull request #533 from bounswe/BACKEND-530
Browse files Browse the repository at this point in the history
BACKEND-530: Modify docker-compose for database volume and create separate yml for BACKEND-DEV
  • Loading branch information
kaanyolcu22 authored Nov 21, 2024
2 parents f4113b1 + 3e8f1db commit 8a74729
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 9 deletions.
9 changes: 0 additions & 9 deletions backend/app/apps.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,11 @@
import json


def create_mockdata(**kwargs):
from .mock_data_manager import create_quiz_mockdata
create_quiz_mockdata()


class AppConfig(AppConfig):
default_auto_field = 'django.db.models.BigAutoField'
name = 'app'

def ready(self):
post_migrate.connect(create_mockdata, sender=self)
import app.signals # Import the signals to ensure they are registered





28 changes: 28 additions & 0 deletions docker-compose-dev-backend.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
services:
db:
image: postgres:15
container_name: postgres_db
restart: always
environment:
POSTGRES_DB: db
POSTGRES_USER: halil
POSTGRES_PASSWORD: 123
volumes:
- ./dbdata:/var/lib/postgresql/data
ports:
- "5432:5432"

web:
build: ./backend
container_name: django_app
volumes:
- ./backend:/app
ports:
- "8000:8000"
env_file:
- .env
depends_on:
- db

volumes:
dbdata:
3 changes: 3 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,6 @@ services:
- /app/node_modules
depends_on:
- web

volumes:
dbdata:

0 comments on commit 8a74729

Please sign in to comment.