forked from coollabsio/coolify
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request coollabsio#2939 from Kaotic/next
Templates: chaskiq, rabbitmq
- Loading branch information
Showing
4 changed files
with
160 additions
and
3 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters