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"