From 36accc3b30a0432ee178ff209c03d3eda275d9ee Mon Sep 17 00:00:00 2001 From: Knee Cola Date: Thu, 25 Dec 2025 13:21:46 +0100 Subject: [PATCH] refactor: create docker-stack workspace for deployment configs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Created dedicated workspace for Docker deployment configurations and scripts. Improves organization by grouping all deployment-related files together. ## New Structure - docker-stack/: Docker Compose files and deployment scripts - docker-compose-standalone.yaml - docker-compose-swarm.yml - docker-compose-debug.yml - deploy-standalone.sh - deploy-swarm.sh - README.md (deployment documentation) - package.json ## Changes - Moved all docker-compose YAML files to docker-stack/ - Moved deploy scripts to docker-stack/ - Updated VS Code workspace to include docker-stack - Updated documentation (README, CLAUDE.md) ## Deployment Workflow 1. Build: `cd web-app && ./build.sh 2.20.0` 2. Deploy: `cd docker-stack && ./deploy-standalone.sh 2.20.0` 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 --- CLAUDE.md | 7 +-- README.md | 13 ++++-- docker-stack/README.md | 46 +++++++++++++++++++ .../deploy-standalone.sh | 0 .../deploy-swarm.sh | 0 .../docker-compose-debug.yml | 0 .../docker-compose-standalone.yaml | 0 .../docker-compose-swarm.yml | 0 docker-stack/package.json | 10 ++++ evidencija-rezija.code-workspace | 4 ++ 10 files changed, 74 insertions(+), 6 deletions(-) create mode 100644 docker-stack/README.md rename deploy-standalone.sh => docker-stack/deploy-standalone.sh (100%) rename deploy-swarm.sh => docker-stack/deploy-swarm.sh (100%) rename docker-compose-debug.yml => docker-stack/docker-compose-debug.yml (100%) rename docker-compose-standalone.yaml => docker-stack/docker-compose-standalone.yaml (100%) rename docker-compose-swarm.yml => docker-stack/docker-compose-swarm.yml (100%) create mode 100644 docker-stack/package.json diff --git a/CLAUDE.md b/CLAUDE.md index e4f9f70..0e824de 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -6,6 +6,7 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co This is a multi-project repository containing: - **web-app/**: Next.js 14 utility bills tracking application +- **docker-stack/**: Docker Compose configurations and deployment scripts - **housekeeping/**: Database backup and maintenance scripts Each project is self-contained with its own dependencies. @@ -30,10 +31,10 @@ All commands should be run from within the respective project directory. ## Deployment Commands -**Building Docker Image** (from web-app directory): -- `cd web-app && ./build.sh ` - Build Docker image +**Building Docker Image** (`cd web-app`): +- `./build.sh ` - Build Docker image -**Deploying** (from repository root): +**Deploying** (`cd docker-stack`): - `./deploy-standalone.sh ` - Deploy with docker-compose (standalone) - `./deploy-swarm.sh ` - Deploy with Docker Swarm diff --git a/README.md b/README.md index cf79d03..905b94f 100644 --- a/README.md +++ b/README.md @@ -17,14 +17,15 @@ Each location record is marked with a user ID. All the actions user `withUser` to fetch user ID, which is then used in all the DB operations. -# Monorepo Structure +# Repository Structure This repository contains multiple independent projects: - **web-app/**: Next.js application for tracking utility bills +- **docker-stack/**: Docker Compose configurations and deployment scripts - **housekeeping/**: Database backup and maintenance scripts -Each project is self-contained with its own dependencies and package.json. +Each project is self-contained with its own dependencies and configuration. ## Working with Projects @@ -34,6 +35,10 @@ cd web-app npm install npm run dev +# Deploy with Docker +cd docker-stack +./deploy-standalone.sh 2.20.0 + # Housekeeping scripts cd housekeeping ./db-backup--standalone.sh @@ -128,9 +133,11 @@ The image will be stored in the local Docker instance. ## Deploying Docker Service -From the repository root: +From the `docker-stack/` directory: ```bash +cd docker-stack + # Standalone deployment ./deploy-standalone.sh 2.20.0 diff --git a/docker-stack/README.md b/docker-stack/README.md new file mode 100644 index 0000000..483d45b --- /dev/null +++ b/docker-stack/README.md @@ -0,0 +1,46 @@ +# Docker Stack + +Docker Compose configurations and deployment scripts for the Evidencija Režija application. + +## Files + +### Docker Compose Configurations + +- `docker-compose-standalone.yaml` - Standalone deployment with docker-compose +- `docker-compose-swarm.yml` - Docker Swarm deployment +- `docker-compose-debug.yml` - Debug/development deployment + +### Deployment Scripts + +- `deploy-standalone.sh` - Deploy standalone configuration +- `deploy-swarm.sh` - Deploy swarm configuration + +## Usage + +### Deploying Standalone + +```bash +cd docker-stack +./deploy-standalone.sh 2.20.0 +``` + +### Deploying to Swarm + +```bash +cd docker-stack +./deploy-swarm.sh 2.20.0 +``` + +## Prerequisites + +- Docker image must be built first: `cd ../web-app && ./build.sh 2.20.0` +- MongoDB data directory: `../mongo-volume/` +- MongoDB backup directory: `../mongo-backup/` + +## Configuration + +All compose files reference: +- Web app image: `utility-bills-tracker:${IMAGE_VERSION}` +- Volume mounts: `../web-app/etc/hosts/` +- MongoDB data: `../mongo-volume/` +- MongoDB backups: `../mongo-backup/` diff --git a/deploy-standalone.sh b/docker-stack/deploy-standalone.sh similarity index 100% rename from deploy-standalone.sh rename to docker-stack/deploy-standalone.sh diff --git a/deploy-swarm.sh b/docker-stack/deploy-swarm.sh similarity index 100% rename from deploy-swarm.sh rename to docker-stack/deploy-swarm.sh diff --git a/docker-compose-debug.yml b/docker-stack/docker-compose-debug.yml similarity index 100% rename from docker-compose-debug.yml rename to docker-stack/docker-compose-debug.yml diff --git a/docker-compose-standalone.yaml b/docker-stack/docker-compose-standalone.yaml similarity index 100% rename from docker-compose-standalone.yaml rename to docker-stack/docker-compose-standalone.yaml diff --git a/docker-compose-swarm.yml b/docker-stack/docker-compose-swarm.yml similarity index 100% rename from docker-compose-swarm.yml rename to docker-stack/docker-compose-swarm.yml diff --git a/docker-stack/package.json b/docker-stack/package.json new file mode 100644 index 0000000..866b77e --- /dev/null +++ b/docker-stack/package.json @@ -0,0 +1,10 @@ +{ + "name": "docker-stack", + "version": "2.20.0", + "private": true, + "description": "Docker deployment configurations and scripts", + "scripts": { + "deploy:standalone": "./deploy-standalone.sh", + "deploy:swarm": "./deploy-swarm.sh" + } +} diff --git a/evidencija-rezija.code-workspace b/evidencija-rezija.code-workspace index 72673b1..21699eb 100644 --- a/evidencija-rezija.code-workspace +++ b/evidencija-rezija.code-workspace @@ -4,6 +4,10 @@ "name": "🌐 web-app", "path": "web-app" }, + { + "name": "🐳 docker-stack", + "path": "docker-stack" + }, { "name": "🔧 housekeeping", "path": "housekeeping"