From 728071221161d96e0e9f1c18c07faf0d4612de29 Mon Sep 17 00:00:00 2001 From: zwnk Date: Thu, 16 Jan 2025 10:17:25 -0300 Subject: [PATCH] first --- README.md | 11 +++++++++++ docker-compose.yml | 39 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 50 insertions(+) create mode 100644 README.md create mode 100644 docker-compose.yml diff --git a/README.md b/README.md new file mode 100644 index 0000000..c23fa74 --- /dev/null +++ b/README.md @@ -0,0 +1,11 @@ +# What is it? + +This is just a small Vue.js demo app with a Django Rest API Backend that writes "Todos" to a Postgesql DB. +It serves as demo to on how to setup the containerization with docker. + +clone the repo. +Adjust the .env files. +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 + diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..b33ab3c --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,39 @@ +services: + db: + image: postgres:13 + volumes: + - postgres_data:/var/lib/postgresql/data + environment: + - POSTGRES_DB=todo_db + - POSTGRES_USER=postgres + - POSTGRES_PASSWORD=postgres + ports: + - "5432:5432" + + backend: + build: ./backend + volumes: + - ./backend:/app + ports: + - "8000:8000" + environment: + - DB_NAME=todo_db + - DB_USER=postgres + - DB_PASSWORD=postgres + - DB_HOST=db + - DB_PORT=5432 + - DEBUG=1 + depends_on: + - db + + frontend: + build: ./frontend + ports: + - "5173:5173" + environment: + - VITE_API_URL=http://localhost:8000/api + depends_on: + - backend + +volumes: + postgres_data: