Merge pull request #2939 from Kaotic/next

Templates: chaskiq, rabbitmq
This commit is contained in:
Andras Bacsai 2024-08-12 11:18:55 +02:00 committed by GitHub
commit 0d994aa2c3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 160 additions and 3 deletions

BIN
public/svgs/chaskiq.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.1 KiB

1
public/svgs/rabbitmq.svg Normal file
View File

@ -0,0 +1 @@
<svg height="271" preserveAspectRatio="xMidYMid" viewBox="0 0 256 271" width="256" xmlns="http://www.w3.org/2000/svg"><path d="m245.44 108.307692h-85.090462c-4.268307 0-7.734153-3.465846-7.734153-7.734154v-88.6793842c0-6.56738457-5.32677-11.8941538-11.889231-11.8941538h-30.375385c-6.567384 0-11.8892305 5.32676923-11.8892305 11.8941538v88.1427692c0 4.573539-3.6972308 8.290462-8.2707693 8.310154l-27.8843077.132923c-4.612923.024615-8.3593846-3.716923-8.3495384-8.324923l.1723077-88.2412308c.0147692-6.57723082-5.312-11.9138462-11.8892308-11.9138462h-30.3507692c-6.56738465 0-11.8892308 5.32676923-11.8892308 11.8941538v248.3150772c0 5.833846 4.72615385 10.56 10.5550769 10.56h234.8849231c5.833846 0 10.56-4.726154 10.56-10.56v-141.341539c0-5.833846-4.726154-10.56-10.56-10.56zm-39.901538 93.233231c0 7.645539-6.198154 13.843692-13.843693 13.843692h-24.004923c-7.645538 0-13.843692-6.198153-13.843692-13.843692v-24.004923c0-7.645538 6.198154-13.843692 13.843692-13.843692h24.004923c7.645539 0 13.843693 6.198154 13.843693 13.843692z" fill="#f60"/></svg>

After

Width:  |  Height:  |  Size: 1.0 KiB

View File

@ -0,0 +1,153 @@
# documentation: https://chaskiq.io
# slogan: Chaskiq is an messaging platform for marketing, support & sales
# tags: chaskiq,messaging,chat,marketing,support,sales,open,source,rails,redis,postgresql,sidekiq
# logo: svgs/chaskiq.png
# port: 3000
services:
chaskiq:
image: chaskiq/chaskiq:latest
environment:
- SERVICE_FQDN_CHASKIQ_3000
- REDIS_URL=redis://redis:6379/
- DATABASE_URL=postgres://$SERVICE_USER_POSTGRES:$SERVICE_PASSWORD_POSTGRES@postgresql:5432/${POSTGRES_DB:-chaskiq}
- POSTGRES_USER=$SERVICE_USER_POSTGRES
- SERVICE_URL=${SERVICE_URL_CHASKIQ}
- HOST=https://${SERVICE_URL_CHASKIQ}
- ASSET_HOST=https://${SERVICE_URL_CHASKIQ}
- WS=wss://${SERVICE_URL_CHASKIQ}/cable
- SNS_CONFIGURATION_SET=metrics
- AWS_ACCESS_KEY_ID=${AWS_ACCESS_KEY_ID:-}
- AWS_SECRET_ACCESS_KEY=${AWS_SECRET_ACCESS_KEY:-}
- AWS_S3_BUCKET=${AWS_S3_BUCKET:-}
- AWS_S3_REGION=${AWS_S3_REGION:-}
- ADMIN_EMAIL=${ADMIN_EMAIL:-admin@example}
- ADMIN_PASSWORD=${ADMIN_PASSWORD:-password}
- DEFAULT_SENDER_EMAIL=${DEFAULT_SENDER_EMAIL:-admin@example}
- LOCAL_STORAGE_PATH=./data/storage
- ACTIVE_STORAGE_SERVICE=${ACTIVE_STORAGE_SERVICE:-local}
- SMTP_DELIVERY_METHOD=${SMTP_DELIVERY_METHOD:-}
- SMTP_ADDRESS=${SMTP_ADDRESS:-}
- SMTP_USERNAME=${SMTP_USERNAME:-}
- SMTP_PASSWORD=${SMTP_PASSWORD:-}
- CHASKIQ_APPSTORE_TOKEN=${CHASKIQ_APPSTORE_TOKEN:-}
- APP_ENV=production
- RAILS_ENV=production
- RACK_ENV=production
- RAILS_SERVE_STATIC_FILES=true
- SECRET_KEY_BASE=$SERVICE_PASSWORD_64_SECRET
- RAILS_LOG_TO_STDOUT=true
- ENABLED_AUDITS=true
- TZ=Europe/Madrid
entrypoint: ["/entrypoint.sh"]
depends_on:
postgresql:
condition: service_healthy
redis:
condition: service_healthy
volumes:
- chaskiq-storage:/data/storage
- type: bind
source: ./entrypoint.sh
target: /entrypoint.sh
content: |
#!/bin/sh
set -e
rm -f /usr/src/app/tmp/pids/server.pid
exec "$@"
while ! pg_isready -q -h postgresql -p 5432 -U $POSTGRES_USER
do
echo "$(date) - waiting for database to start."
sleep 2
done
echo "Running database migrations..."
bundle exec rails db:setup
bundle exec rails db:migrate
echo "Finished running database migrations."
echo "Running packages update..."
bundle exec rails packages:update
echo "Finished packages update."
if [ ! -f /usr/src/app/admin_generated ]; then
echo "/usr/src/app/admin_generated not found, executing admin generation.."
bundle exec rake admin_generator
touch /usr/src/app/admin_generated
echo "Admin generation finished !"
fi
bundle exec rails s -b 0.0.0.0 -p 3000
healthcheck:
test: ["CMD", "curl", "-f", "http://127.0.0.1:3000"]
interval: 15s
timeout: 20s
retries: 15
sidekiq:
image: chaskiq/chaskiq:latest
environment:
- REDIS_URL=redis://redis:6379/
- DATABASE_URL=postgres://$SERVICE_USER_POSTGRES:$SERVICE_PASSWORD_POSTGRES@postgresql:5432/${POSTGRES_DB:-chaskiq}
- POSTGRES_USER=$SERVICE_USER_POSTGRES
- HOST=https://${SERVICE_URL_CHASKIQ}
- ASSET_HOST=https://${SERVICE_URL_CHASKIQ}
- WS=wss://${SERVICE_URL_CHASKIQ}/cable
- SNS_CONFIGURATION_SET=metrics
- AWS_ACCESS_KEY_ID=${AWS_ACCESS_KEY_ID:-}
- AWS_SECRET_ACCESS_KEY=${AWS_SECRET_ACCESS_KEY:-}
- AWS_S3_BUCKET=${AWS_S3_BUCKET:-}
- AWS_S3_REGION=${AWS_S3_REGION:-}
- ADMIN_EMAIL=${ADMIN_EMAIL:-admin@example}
- ADMIN_PASSWORD=${ADMIN_PASSWORD:-password}
- DEFAULT_SENDER_EMAIL=${DEFAULT_SENDER_EMAIL:-admin@example}
- LOCAL_STORAGE_PATH=./data/storage
- ACTIVE_STORAGE_SERVICE=${ACTIVE_STORAGE_SERVICE:-local}
- SMTP_DELIVERY_METHOD=${SMTP_DELIVERY_METHOD:-}
- SMTP_ADDRESS=${SMTP_ADDRESS:-}
- SMTP_USERNAME=${SMTP_USERNAME:-}
- SMTP_PASSWORD=${SMTP_PASSWORD:-}
- CHASKIQ_APPSTORE_TOKEN=${CHASKIQ_APPSTORE_TOKEN:-}
- APP_ENV=production
- RAILS_ENV=production
- RACK_ENV=production
- RAILS_SERVE_STATIC_FILES=true
- SECRET_KEY_BASE=$SERVICE_PASSWORD_64_SECRET
- RAILS_LOG_TO_STDOUT=true
- ENABLED_AUDITS=true
- TZ=Europe/Madrid
volumes:
- chaskiq-storage:/data/storage
depends_on:
postgresql:
condition: service_healthy
redis:
condition: service_healthy
chaskiq:
condition: service_healthy
command: ['bundle', 'exec', 'sidekiq', '-C', 'config/sidekiq.yml']
healthcheck:
test: ["CMD-SHELL", "bundle exec rails runner 'puts Sidekiq.redis(&:info)' > /dev/null 2>&1"]
interval: 30s
timeout: 10s
retries: 3
postgresql:
image: postgres:14-alpine
volumes:
- postgresql-data:/var/lib/postgresql/data
environment:
- POSTGRES_USER=$SERVICE_USER_POSTGRES
- POSTGRES_PASSWORD=$SERVICE_PASSWORD_POSTGRES
- POSTGRES_DB=${POSTGRES_DB:-chaskiq}
- POSTGRES_INITDB_ARGS= --data-checksums
- PSQL_HISTFILE=/root/log/.psql_history
healthcheck:
test: ["CMD-SHELL", "pg_isready -U $${POSTGRES_USER} -d $${POSTGRES_DB}"]
interval: 10s
timeout: 5s
retries: 10
redis:
image: redis:6-alpine
restart: always
volumes:
- redis-data:/data
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 10s
timeout: 5s
retries: 10

View File

@ -1,15 +1,18 @@
# ignore: true
# documentation: https://www.rabbitmq.com/documentation.html
# slogan: With tens of thousands of users, RabbitMQ is one of the most popular open source message brokers.
# tags: message broker, message queue, message-oriented middleware, MOM, AMQP, MQTT, STOMP, messaging
# logo: svgs/rabbitmq.svg
# port: 15672
services:
rabbitmq:
image: rabbitmq:3
image: rabbitmq:3-management
environment:
- SERVICE_FQDN_RABBITMQ_5672
- SERVICE_FQDN_RABBITMQ_15672
- RABBITMQ_DEFAULT_USER=$SERVICE_USER_RABBITMQ
- RABBITMQ_DEFAULT_PASS=$SERVICE_PASSWORD_RABBITMQ
ports:
- 5672:5672
healthcheck:
test: rabbitmq-diagnostics -q ping
interval: 30s