Setup ChartBrew on Coolify
Problem:
I tried running ChartBrew on Coolify, but it initially didn't work, as I was getting this error: ArgError: option requires argument: -l (alias for --listen)
Solution:
Use this Docker Compose file and set the env variables mentioned at the end (using the Developer View in Environment Variables in Coolify).
New Resource → Docker Compose Empty
version: '3.8'
services:
db:
image: 'mysql:8.4'
restart: unless-stopped
environment:
MYSQL_DATABASE: '${CB_DB_NAME}'
MYSQL_USER: '${CB_DB_USERNAME}'
MYSQL_PASSWORD: '${CB_DB_PASSWORD}'
MYSQL_ROOT_PASSWORD: '${CB_DB_ROOT_PASSWORD}'
MYSQL_DEFAULT_AUTH: caching_sha2_password
volumes:
- 'chartbrew-db:/var/lib/mysql'
healthcheck:
test:
- CMD
- mysqladmin
- ping
- '-h'
- localhost
interval: 10s
timeout: 5s
retries: 5
redis:
image: 'redis:alpine'
restart: unless-stopped
command:
- redis-server
- '--requirepass'
- '${CB_REDIS_PASSWORD}'
ports:
- '6379:6379'
chartbrew:
image: razvanilin/chartbrew
restart: unless-stopped
env_file: .env
ports:
- '4018:4018'
- '4019:4019'
depends_on:
db:
condition: service_healthy
redis:
condition: service_started
volumes:
chartbrew-db: null
docker-compose.yml
Environment Variables
CB_DB_PASSWORD=SOME_RAND_PASS
CB_DB_ROOT_PASSWORD=OTHER_RAND_PASS
CB_REDIS_PASSWORD=YET_OTHER_RAND_PASS
CB_ENCRYPTION_KEY=GENERATE_THIS!!
CB_ENCRYPTION_KEY_DEV=GENERATE_THIS!!
CB_DB_NAME=chartbrew
CB_DB_USERNAME=chartbrewuser
CB_DB_HOST=db
CB_API_HOST=0.0.0.0
CB_API_PORT=4019
VITE_APP_CLIENT_HOST=http://localhost:4018
VITE_APP_CLIENT_PORT=4018
VITE_APP_API_HOST=http://localhost:4019
To generate the encryption keys, run this command (assuming you have Node.js running locally):
node -e "console.log(require('crypto').randomBytes(32).toString('hex'))"
Gotchas:
- Make sure port 4019 is exposed on your Coolify instance
sudo firewall-cmd --add-port=4019/tcp --permanent
sudo firewall-cmd --reload - Make sure to replace the domain in
VITE_APP_CLIENT_HOST
andVITE_APP_API_HOST
with your actual domain name.
Do you encounter any errors? Do you have any tips? Write them in the comments.