From 1f3190d6a702c4be27ae36f0803b04351204cbd4 Mon Sep 17 00:00:00 2001 From: a7hu-15 Date: Sat, 4 Jul 2026 10:43:51 +0530 Subject: [PATCH] build: create master docker-compose configuration for full stack setup --- README.md | 15 +++++ .../docker-compose.yml => docker-compose.yml | 64 +++++++------------ frontend/Dockerfile | 7 ++ 3 files changed, 46 insertions(+), 40 deletions(-) rename backend/docker-compose.yml => docker-compose.yml (65%) create mode 100644 frontend/Dockerfile diff --git a/README.md b/README.md index 97a788c8..b95d2ed4 100644 --- a/README.md +++ b/README.md @@ -329,6 +329,21 @@ cd devlink --- +## One-Click Setup (Docker) + +The easiest way to run the entire DevLink stack (Frontend, Backend, PostgreSQL, and Redis) locally is using Docker Compose. + +```bash +docker compose up --build +``` + +The application will be available at: +- Frontend: `http://localhost:5173` +- Backend API: `http://localhost:8000` +- API Documentation: `http://localhost:8000/docs` + +--- + ## Backend Setup ```bash diff --git a/backend/docker-compose.yml b/docker-compose.yml similarity index 65% rename from backend/docker-compose.yml rename to docker-compose.yml index b73849c1..7ee81645 100644 --- a/backend/docker-compose.yml +++ b/docker-compose.yml @@ -1,95 +1,79 @@ version: "3.9" services: - - # ========================================================== - # PostgreSQL - # ========================================================== - postgres: image: postgres:16-alpine container_name: devlink-postgres - restart: unless-stopped - environment: - POSTGRES_DB: devlink - POSTGRES_USER: postgres - POSTGRES_PASSWORD: devlink123 - + POSTGRES_DB: devlink + POSTGRES_USER: postgres + POSTGRES_PASSWORD: devlink123 ports: - "5432:5432" - volumes: - postgres_data:/var/lib/postgresql/data - healthcheck: test: ["CMD-SHELL", "pg_isready -U postgres -d devlink"] interval: 10s timeout: 5s retries: 5 - # ========================================================== - # Redis - # ========================================================== - redis: image: redis:7-alpine container_name: devlink-redis - restart: unless-stopped - command: redis-server --appendonly yes - ports: - "6379:6379" - volumes: - redis_data:/data - healthcheck: test: ["CMD", "redis-cli", "ping"] interval: 10s timeout: 5s retries: 5 - # ========================================================== - # FastAPI Backend - # ========================================================== - backend: build: - context: . + context: ./backend dockerfile: Dockerfile - container_name: devlink-backend - restart: unless-stopped - env_file: - - .env - + - ./backend/.env depends_on: postgres: condition: service_healthy - redis: condition: service_healthy - ports: - "8000:8000" - volumes: - - .:/app - + - ./backend:/app command: > uvicorn app.main:app --host 0.0.0.0 --port 8000 --reload -volumes: + frontend: + build: + context: ./frontend + dockerfile: Dockerfile + container_name: devlink-frontend + restart: unless-stopped + environment: + - VITE_API_URL=http://localhost:8000 + - CHOKIDAR_USEPOLLING=true + ports: + - "5173:5173" + volumes: + - ./frontend:/app + - /app/node_modules + depends_on: + - backend +volumes: postgres_data: - - redis_data: \ No newline at end of file + redis_data: diff --git a/frontend/Dockerfile b/frontend/Dockerfile new file mode 100644 index 00000000..223d49ba --- /dev/null +++ b/frontend/Dockerfile @@ -0,0 +1,7 @@ +FROM node:20-alpine +WORKDIR /app +COPY package*.json ./ +RUN npm ci +COPY . . +EXPOSE 5173 +CMD ["npm", "run", "dev", "--", "--host"]