122 lines
3.4 KiB
YAML
122 lines
3.4 KiB
YAML
|
|
version: '3'
|
||
|
|
|
||
|
|
services:
|
||
|
|
rails:
|
||
|
|
image: chatwoot/chatwoot:latest
|
||
|
|
container_name: {{ customer }}-chatwoot-rails
|
||
|
|
env_file: /opt/letsbe/env/chatwoot.env
|
||
|
|
restart: always
|
||
|
|
labels:
|
||
|
|
- "diun.enable=true"
|
||
|
|
depends_on:
|
||
|
|
- postgres
|
||
|
|
- redis
|
||
|
|
ports:
|
||
|
|
- '127.0.0.1:3011: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']
|
||
|
|
volumes:
|
||
|
|
- {{ customer }}-chatwoot-storage:/app/storage
|
||
|
|
- {{ customer }}-chatwoot-backups:/tmp/backups
|
||
|
|
networks:
|
||
|
|
{{ customer }}-chatwoot:
|
||
|
|
ipv4_address: 172.20.1.2
|
||
|
|
|
||
|
|
sidekiq:
|
||
|
|
container_name: {{ customer }}-chatwoot-sidekiq
|
||
|
|
image: chatwoot/chatwoot:latest
|
||
|
|
restart: always
|
||
|
|
env_file: /opt/letsbe/env/chatwoot.env
|
||
|
|
depends_on:
|
||
|
|
- postgres
|
||
|
|
- redis
|
||
|
|
environment:
|
||
|
|
- NODE_ENV=production
|
||
|
|
- RAILS_ENV=production
|
||
|
|
- INSTALLATION_ENV=docker
|
||
|
|
command: ['bundle', 'exec', 'sidekiq', '-C', 'config/sidekiq.yml']
|
||
|
|
volumes:
|
||
|
|
- {{ customer }}-chatwoot-storage:/app/storage
|
||
|
|
networks:
|
||
|
|
{{ customer }}-chatwoot:
|
||
|
|
ipv4_address: 172.20.1.3
|
||
|
|
|
||
|
|
postgres:
|
||
|
|
container_name: {{ customer }}-chatwoot-postgres
|
||
|
|
image: pgvector/pgvector:pg16
|
||
|
|
restart: always
|
||
|
|
ports:
|
||
|
|
- '127.0.0.1:3049:5432'
|
||
|
|
volumes:
|
||
|
|
- {{ customer }}-chatwoot-postgres:/var/lib/postgresql/data
|
||
|
|
- {{ customer }}-chatwoot-backups:/tmp/backups
|
||
|
|
environment:
|
||
|
|
- POSTGRES_DB=chatwoot_production
|
||
|
|
- POSTGRES_USER={{ chatwoot_postgres_username }}
|
||
|
|
# Please provide your own password.
|
||
|
|
- POSTGRES_PASSWORD={{ chatwoot_postgres_password }}
|
||
|
|
networks:
|
||
|
|
{{ customer }}-chatwoot:
|
||
|
|
ipv4_address: 172.20.1.4
|
||
|
|
|
||
|
|
redis:
|
||
|
|
image: redis:alpine
|
||
|
|
container_name: {{ customer }}-chatwoot-redis
|
||
|
|
restart: always
|
||
|
|
command: ["sh", "-c", "redis-server --requirepass \"$REDIS_PASSWORD\""]
|
||
|
|
env_file: /opt/letsbe/env/chatwoot.env
|
||
|
|
volumes:
|
||
|
|
- {{ customer }}-chatwoot-redis:/data
|
||
|
|
ports:
|
||
|
|
- '127.0.0.1:3050:6379'
|
||
|
|
networks:
|
||
|
|
{{ customer }}-chatwoot:
|
||
|
|
ipv4_address: 172.20.1.5
|
||
|
|
|
||
|
|
getmail:
|
||
|
|
image: python:3.12-alpine
|
||
|
|
container_name: {{ customer }}-chatwoot-getmail
|
||
|
|
restart: always
|
||
|
|
depends_on:
|
||
|
|
- rails
|
||
|
|
environment:
|
||
|
|
INGRESS_PASSWORD: ${RAILS_INBOUND_EMAIL_PASSWORD}
|
||
|
|
CHATWOOT_RELAY_URL: http://rails:3000/rails/action_mailbox/relay/inbound_emails
|
||
|
|
volumes:
|
||
|
|
- type: bind
|
||
|
|
source: /opt/letsbe/stacks/chatwoot/getmail
|
||
|
|
target: /opt/getmail
|
||
|
|
entrypoint: >
|
||
|
|
sh -c "
|
||
|
|
apk add --no-cache curl ca-certificates &&
|
||
|
|
pip install --no-cache-dir getmail6 &&
|
||
|
|
chmod +x /opt/getmail/import_mail_to_chatwoot || true &&
|
||
|
|
while true; do
|
||
|
|
for f in /opt/getmail/getmailrc /opt/getmail/getmailrc-*; do
|
||
|
|
[ -f \"$f\" ] || continue
|
||
|
|
getmail --getmaildir /opt/getmail --rcfile \"$(basename \"$f\")\" --quiet > done
|
||
|
|
sleep 60
|
||
|
|
done
|
||
|
|
"
|
||
|
|
networks:
|
||
|
|
{{ customer }}-chatwoot:
|
||
|
|
ipv4_address: 172.20.1.6
|
||
|
|
|
||
|
|
networks:
|
||
|
|
{{ customer }}-chatwoot:
|
||
|
|
ipam:
|
||
|
|
driver: default
|
||
|
|
config:
|
||
|
|
- subnet: 172.20.1.0/28
|
||
|
|
gateway: 172.20.1.1
|
||
|
|
|
||
|
|
volumes:
|
||
|
|
{{ customer }}-chatwoot-storage:
|
||
|
|
{{ customer }}-chatwoot-postgres:
|
||
|
|
{{ customer }}-chatwoot-redis:
|
||
|
|
{{ customer }}-chatwoot-backups:
|