diff --git a/.github/workflows/code-quality.yml b/.github/workflows/code-quality.yml index f8559c3..39b5536 100644 --- a/.github/workflows/code-quality.yml +++ b/.github/workflows/code-quality.yml @@ -98,8 +98,6 @@ jobs: steps: - name: Checkout code uses: actions/checkout@v4 - - name: Create volume directories - run: bash scripts/setup_volumes.sh - name: Copy .env file run: cp .env.example .env - name: Set up Docker Buildx diff --git a/README.md b/README.md index 4ced15e..557db24 100644 --- a/README.md +++ b/README.md @@ -22,16 +22,6 @@ This project uses custom Docker images built from the following Dockerfiles: ## Usage -### Prepare volume directories - -Before starting the services, run the setup script to create the necessary volume directories: - -```bash -./scripts/setup_volumes.sh -``` - -This prevents volume mount errors that may occur if the directories don't exist. - ### Create environment file Create a `.env` file in the root directory of the project with your environment variables: @@ -44,11 +34,19 @@ Then edit the `.env` file to set your specific configuration values. ### Starting the services +You can start the services in two ways, depending on your environment: + +#### 1. Development + ```bash docker compose up -d ``` -This will start all services in detached mode. +#### 2. Production + +```bash +docker-compose -f docker-compose.yml -f docker-compose.prod.yml up -d +``` ### Building custom images @@ -138,11 +136,14 @@ docker compose down -v ## Data Persistence -All data is stored in local volumes under the `./volumes/` directory: +Data for all services is persisted using Docker volumes. The storage location depends on the environment: + +- **Development (default, using `docker-compose.yml`)**: Docker uses anonymous volumes for each service. These are managed by Docker and are not bound to any directory in your project. Data persists as long as the volume exists, but is not directly accessible from the project folder. -- `./volumes/n8n_data` - n8n data and workflows -- `./volumes/opensearch-data` - OpenSearch data for Temporal -- `./volumes/postgresql-data` - PostgreSQL database for Temporal +- **Production (using `docker-compose.prod.yml`)**: Volumes are explicitly bound to host directories under `/data/` for persistent storage and easier backup/restore. + +> **Note:** +> - Removing volumes with `docker compose down -v` will delete all persisted data. ## Service Ports @@ -166,12 +167,6 @@ If you encounter any issues: 3. Make sure Docker has sufficient resources allocated -4. If you encounter volume mount errors (e.g., "failed to mount local volume ... no such file or directory"), run the setup script: - ```bash - ./scripts/setup_volumes.sh - ``` - This creates the necessary volume directories in the `./volumes/` folder. - ## GitHub MCP Configuration To use GitHub-related functions with Cursor's Machine Coding Protocol (MCP), you need to configure a GitHub Personal Access Token: diff --git a/docker-compose.prod.yml b/docker-compose.prod.yml new file mode 100644 index 0000000..b253a3b --- /dev/null +++ b/docker-compose.prod.yml @@ -0,0 +1,19 @@ +volumes: + n8n_data: + driver: local + driver_opts: + type: none + o: bind + device: /data/n8n + opensearch-data: + driver: local + driver_opts: + type: none + o: bind + device: /data/opensearch + postgresql-data: + driver: local + driver_opts: + type: none + o: bind + device: /data/postgresql diff --git a/docker-compose.yml b/docker-compose.yml index d3e1cdb..45e9f32 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -129,23 +129,8 @@ services: volumes: n8n_data: - driver: local - driver_opts: - type: none - o: bind - device: ${PWD}/volumes/n8n_data opensearch-data: - driver: local - driver_opts: - type: none - o: bind - device: ${PWD}/volumes/opensearch-data postgresql-data: - driver: local - driver_opts: - type: none - o: bind - device: ${PWD}/volumes/postgresql-data networks: app-network: diff --git a/scripts/setup_volumes.sh b/scripts/setup_volumes.sh deleted file mode 100755 index c5c2c84..0000000 --- a/scripts/setup_volumes.sh +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/bash - -# Create volume directories for Docker Compose -echo "Setting up volume directories..." -mkdir -p volumes/opensearch-data -mkdir -p volumes/postgresql-data -mkdir -p volumes/n8n_data - -# Set broader permissions to ensure Docker can access these directories -echo "Setting permissions for Docker access..." -chmod -R 777 volumes/opensearch-data -chmod -R 777 volumes/postgresql-data -chmod -R 777 volumes/n8n_data - -echo "Volume directories created successfully with Docker-accessible permissions." \ No newline at end of file