From 0c8278d2776c8279d03883b5936b30bf6358fa8f Mon Sep 17 00:00:00 2001 From: netlas Date: Wed, 22 Apr 2026 14:01:12 +0300 Subject: [PATCH] chore: update production compose to use pre-built image, keep build version for reference --- docker-compose.build.yaml | 64 ++++++++++++++++++++++++++++++++++ docker-compose.production.yaml | 18 +++++----- 2 files changed, 72 insertions(+), 10 deletions(-) create mode 100644 docker-compose.build.yaml diff --git a/docker-compose.build.yaml b/docker-compose.build.yaml new file mode 100644 index 000000000..15d460e39 --- /dev/null +++ b/docker-compose.build.yaml @@ -0,0 +1,64 @@ +version: '3' + +services: + base: &base + build: + context: . + dockerfile: docker/Dockerfile + env_file: .env ## Change this file for customized env variables + volumes: + - storage_data:/app/storage + + rails: + <<: *base + depends_on: + - postgres + - redis + ports: + - '127.0.0.1:3001:3000' + environment: + - NODE_ENV=production + - RAILS_ENV=production + - INSTALLATION_ENV=docker + entrypoint: docker/entrypoints/rails.sh + command: ['bundle', 'exec', 'rails', 's', '-p', '3000', '-b', '0.0.0.0'] + restart: always + + sidekiq: + <<: *base + depends_on: + - postgres + - redis + environment: + - NODE_ENV=production + - RAILS_ENV=production + - INSTALLATION_ENV=docker + command: ['bundle', 'exec', 'sidekiq', '-C', 'config/sidekiq.yml'] + restart: always + + postgres: + image: pgvector/pgvector:pg16 + restart: always + ports: + - '127.0.0.1:5432:5432' + volumes: + - postgres_data:/var/lib/postgresql/data + environment: + - POSTGRES_DB=chatwoot + - POSTGRES_USER=postgres + - POSTGRES_PASSWORD=${POSTGRES_PASSWORD} + + redis: + image: redis:alpine + restart: always + command: ["sh", "-c", "redis-server --requirepass \"$REDIS_PASSWORD\""] + env_file: .env + volumes: + - redis_data:/data + ports: + - '127.0.0.1:6380:6379' + +volumes: + storage_data: + postgres_data: + redis_data: diff --git a/docker-compose.production.yaml b/docker-compose.production.yaml index 15d460e39..d2ae30835 100644 --- a/docker-compose.production.yaml +++ b/docker-compose.production.yaml @@ -1,38 +1,36 @@ version: '3' services: - base: &base - build: - context: . - dockerfile: docker/Dockerfile - env_file: .env ## Change this file for customized env variables - volumes: - - storage_data:/app/storage - rails: - <<: *base + image: git.leadmagnet.dev/leadmagnet/leadchat:latest depends_on: - postgres - redis ports: - '127.0.0.1:3001:3000' + env_file: .env environment: - NODE_ENV=production - RAILS_ENV=production - INSTALLATION_ENV=docker + volumes: + - storage_data:/app/storage entrypoint: docker/entrypoints/rails.sh command: ['bundle', 'exec', 'rails', 's', '-p', '3000', '-b', '0.0.0.0'] restart: always sidekiq: - <<: *base + image: git.leadmagnet.dev/leadmagnet/leadchat:latest depends_on: - postgres - redis + env_file: .env environment: - NODE_ENV=production - RAILS_ENV=production - INSTALLATION_ENV=docker + volumes: + - storage_data:/app/storage command: ['bundle', 'exec', 'sidekiq', '-C', 'config/sidekiq.yml'] restart: always