From eb47d330c8d2b83f26c5720e7b23709f2be25e67 Mon Sep 17 00:00:00 2001 From: zwnk Date: Thu, 16 Jan 2025 10:25:12 -0300 Subject: [PATCH] dc.yml adjusted --- README.md | 4 ++++ docker-compose.override.yml | 8 ++++++++ docker-compose.yml | 10 ++++++---- 3 files changed, 18 insertions(+), 4 deletions(-) create mode 100644 docker-compose.override.yml diff --git a/README.md b/README.md index c23fa74..0171da5 100644 --- a/README.md +++ b/README.md @@ -9,3 +9,7 @@ run: ```docker compose up --build``` run: ```docker-compose exec backend python manage.py createsuperuser``` and create a user in the backend. the frontend runs on http://localhost:5173 + +local dev: +enables live updates of the code during development, no rebuild needed: +```docker-compose -f docker-compose.yml -f docker-compose.override.yml up``` diff --git a/docker-compose.override.yml b/docker-compose.override.yml new file mode 100644 index 0000000..9e78ec2 --- /dev/null +++ b/docker-compose.override.yml @@ -0,0 +1,8 @@ +services: + backend: + volumes: + - /path/to/local/backend:/app + + frontend: + volumes: + - /path/to/local/frontend:/app diff --git a/docker-compose.yml b/docker-compose.yml index b33ab3c..d465424 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -11,9 +11,9 @@ services: - "5432:5432" backend: - build: ./backend - volumes: - - ./backend:/app + build: + context: git://github.com/your-org/my-project-backend.git#main # Replace with your backend repo URL + dockerfile: Dockerfile ports: - "8000:8000" environment: @@ -27,7 +27,9 @@ services: - db frontend: - build: ./frontend + build: + context: git://github.com/your-org/my-project-frontend.git#main # Replace with your frontend repo URL + dockerfile: Dockerfile ports: - "5173:5173" environment: