Add new coolify
This commit is contained in:
289
coolify/proxy/acme.json
Normal file
289
coolify/proxy/acme.json
Normal file
File diff suppressed because one or more lines are too long
52
coolify/proxy/docker-compose.yml
Normal file
52
coolify/proxy/docker-compose.yml
Normal file
@@ -0,0 +1,52 @@
|
|||||||
|
name: coolify-proxy
|
||||||
|
networks:
|
||||||
|
coolify:
|
||||||
|
external: true
|
||||||
|
services:
|
||||||
|
traefik:
|
||||||
|
container_name: coolify-proxy
|
||||||
|
image: 'traefik:v3.1'
|
||||||
|
restart: unless-stopped
|
||||||
|
extra_hosts:
|
||||||
|
- 'host.docker.internal:host-gateway'
|
||||||
|
networks:
|
||||||
|
- coolify
|
||||||
|
ports:
|
||||||
|
- '80:80'
|
||||||
|
- '443:443'
|
||||||
|
- '443:443/udp'
|
||||||
|
- '8080:8080'
|
||||||
|
healthcheck:
|
||||||
|
test: 'wget -qO- http://localhost:80/ping || exit 1'
|
||||||
|
interval: 4s
|
||||||
|
timeout: 2s
|
||||||
|
retries: 5
|
||||||
|
volumes:
|
||||||
|
- '/var/run/docker.sock:/var/run/docker.sock:ro'
|
||||||
|
- '/data/coolify/proxy/:/traefik'
|
||||||
|
command:
|
||||||
|
- '--ping=true'
|
||||||
|
- '--ping.entrypoint=http'
|
||||||
|
- '--api.dashboard=true'
|
||||||
|
- '--entrypoints.http.address=:80'
|
||||||
|
- '--entrypoints.https.address=:443'
|
||||||
|
- '--entrypoints.http.http.encodequerysemicolons=true'
|
||||||
|
- '--entryPoints.http.http2.maxConcurrentStreams=250'
|
||||||
|
- '--entrypoints.https.http.encodequerysemicolons=true'
|
||||||
|
- '--entryPoints.https.http2.maxConcurrentStreams=250'
|
||||||
|
- '--entrypoints.https.http3'
|
||||||
|
- '--providers.file.directory=/traefik/dynamic/'
|
||||||
|
- '--providers.file.watch=true'
|
||||||
|
- '--certificatesresolvers.letsencrypt.acme.httpchallenge=true'
|
||||||
|
- '--certificatesresolvers.letsencrypt.acme.httpchallenge.entrypoint=http'
|
||||||
|
- '--certificatesresolvers.letsencrypt.acme.storage=/traefik/acme.json'
|
||||||
|
- '--api.insecure=false'
|
||||||
|
- '--providers.docker=true'
|
||||||
|
- '--providers.docker.exposedbydefault=false'
|
||||||
|
labels:
|
||||||
|
- traefik.enable=true
|
||||||
|
- traefik.http.routers.traefik.entrypoints=http
|
||||||
|
- traefik.http.routers.traefik.service=api@internal
|
||||||
|
- traefik.http.services.traefik.loadbalancer.server.port=8080
|
||||||
|
- coolify.managed=true
|
||||||
|
- coolify.proxy=true
|
1
coolify/proxy/dynamic/Caddyfile
Normal file
1
coolify/proxy/dynamic/Caddyfile
Normal file
@@ -0,0 +1 @@
|
|||||||
|
import /dynamic/*.caddy
|
18
coolify/proxy/dynamic/default_redirect_503.yaml
Normal file
18
coolify/proxy/dynamic/default_redirect_503.yaml
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
# This file is generated by Coolify, do not edit it manually.
|
||||||
|
# Disable the default redirect to customize (only if you know what are you doing).
|
||||||
|
|
||||||
|
http:
|
||||||
|
routers:
|
||||||
|
catchall:
|
||||||
|
entryPoints:
|
||||||
|
- http
|
||||||
|
- https
|
||||||
|
service: noop
|
||||||
|
rule: PathPrefix(`/`)
|
||||||
|
tls:
|
||||||
|
certResolver: letsencrypt
|
||||||
|
priority: -1000
|
||||||
|
services:
|
||||||
|
noop:
|
||||||
|
loadBalancer:
|
||||||
|
servers: { }
|
BIN
coolify/sentinel/metrics.sqlite
Normal file
BIN
coolify/sentinel/metrics.sqlite
Normal file
Binary file not shown.
BIN
coolify/sentinel/metrics.sqlite-shm
Normal file
BIN
coolify/sentinel/metrics.sqlite-shm
Normal file
Binary file not shown.
BIN
coolify/sentinel/metrics.sqlite-wal
Normal file
BIN
coolify/sentinel/metrics.sqlite-wal
Normal file
Binary file not shown.
16
coolify/source/.env
Normal file
16
coolify/source/.env
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
APP_ID=9f356a6ef26a3bee4830d432374a6861
|
||||||
|
APP_NAME=Coolify
|
||||||
|
APP_KEY=base64:UTYfoaHz8AFyUXLVh2dZqNPqe4danEt+ATyYQ6p9nqs=
|
||||||
|
|
||||||
|
DB_USERNAME=coolify
|
||||||
|
DB_PASSWORD=2YzWcPMTLC6rQhc2TMafFuu1sr/wwe1ii6fNcezoM+E=
|
||||||
|
REDIS_PASSWORD=3dJYVX+iDUaP4w0MMl7SURMAHYWlhpXGWVMSBrAH8gU=
|
||||||
|
PUSHER_APP_ID=844ac4cfed1fc47de6ab1a682058e3c259a994c56d952dc27aeb8c28ef6b882b
|
||||||
|
PUSHER_APP_KEY=b2c443093f0e17fb276b6ca39729f8c78ea846ce288a814dd40a28068328cd96
|
||||||
|
PUSHER_APP_SECRET=97584e8f90237b0396088d066be8ac7394d944e27dcaeef80580f170a41d8f33
|
||||||
|
ROOT_USERNAME=
|
||||||
|
ROOT_USER_EMAIL=
|
||||||
|
ROOT_USER_PASSWORD=
|
||||||
|
REGISTRY_URL=ghcr.io
|
||||||
|
DOCKER_ADDRESS_POOL_BASE=10.0.0.0/8
|
||||||
|
DOCKER_ADDRESS_POOL_SIZE=24
|
18
coolify/source/.env.production
Executable file
18
coolify/source/.env.production
Executable file
@@ -0,0 +1,18 @@
|
|||||||
|
APP_ID=
|
||||||
|
APP_NAME=Coolify
|
||||||
|
APP_KEY=
|
||||||
|
|
||||||
|
DB_USERNAME=coolify
|
||||||
|
DB_PASSWORD=
|
||||||
|
|
||||||
|
REDIS_PASSWORD=
|
||||||
|
|
||||||
|
PUSHER_APP_ID=
|
||||||
|
PUSHER_APP_KEY=
|
||||||
|
PUSHER_APP_SECRET=
|
||||||
|
|
||||||
|
ROOT_USERNAME=
|
||||||
|
ROOT_USER_EMAIL=
|
||||||
|
ROOT_USER_PASSWORD=
|
||||||
|
|
||||||
|
REGISTRY_URL=ghcr.io
|
90
coolify/source/docker-compose.prod.yml
Executable file
90
coolify/source/docker-compose.prod.yml
Executable file
@@ -0,0 +1,90 @@
|
|||||||
|
services:
|
||||||
|
coolify:
|
||||||
|
image: "${REGISTRY_URL:-ghcr.io}/coollabsio/coolify:${LATEST_IMAGE:-latest}"
|
||||||
|
volumes:
|
||||||
|
- type: bind
|
||||||
|
source: /data/coolify/source/.env
|
||||||
|
target: /var/www/html/.env
|
||||||
|
read_only: true
|
||||||
|
- /data/coolify/ssh:/var/www/html/storage/app/ssh
|
||||||
|
- /data/coolify/applications:/var/www/html/storage/app/applications
|
||||||
|
- /data/coolify/databases:/var/www/html/storage/app/databases
|
||||||
|
- /data/coolify/services:/var/www/html/storage/app/services
|
||||||
|
- /data/coolify/backups:/var/www/html/storage/app/backups
|
||||||
|
- /data/coolify/webhooks-during-maintenance:/var/www/html/storage/app/webhooks-during-maintenance
|
||||||
|
environment:
|
||||||
|
- APP_ENV=${APP_ENV:-production}
|
||||||
|
- PHP_MEMORY_LIMIT=${PHP_MEMORY_LIMIT:-256M}
|
||||||
|
- PHP_FPM_PM_CONTROL=${PHP_FPM_PM_CONTROL:-dynamic}
|
||||||
|
- PHP_FPM_PM_START_SERVERS=${PHP_FPM_PM_START_SERVERS:-1}
|
||||||
|
- PHP_FPM_PM_MIN_SPARE_SERVERS=${PHP_FPM_PM_MIN_SPARE_SERVERS:-1}
|
||||||
|
- PHP_FPM_PM_MAX_SPARE_SERVERS=${PHP_FPM_PM_MAX_SPARE_SERVERS:-10}
|
||||||
|
env_file:
|
||||||
|
- /data/coolify/source/.env
|
||||||
|
ports:
|
||||||
|
- "${APP_PORT:-8000}:8080"
|
||||||
|
expose:
|
||||||
|
- "${APP_PORT:-8000}"
|
||||||
|
healthcheck:
|
||||||
|
test: curl --fail http://127.0.0.1:8080/api/health || exit 1
|
||||||
|
interval: 5s
|
||||||
|
retries: 10
|
||||||
|
timeout: 2s
|
||||||
|
depends_on:
|
||||||
|
postgres:
|
||||||
|
condition: service_healthy
|
||||||
|
redis:
|
||||||
|
condition: service_healthy
|
||||||
|
soketi:
|
||||||
|
condition: service_healthy
|
||||||
|
postgres:
|
||||||
|
volumes:
|
||||||
|
- coolify-db:/var/lib/postgresql/data
|
||||||
|
environment:
|
||||||
|
POSTGRES_USER: "${DB_USERNAME}"
|
||||||
|
POSTGRES_PASSWORD: "${DB_PASSWORD}"
|
||||||
|
POSTGRES_DB: "${DB_DATABASE:-coolify}"
|
||||||
|
healthcheck:
|
||||||
|
test: [ "CMD-SHELL", "pg_isready -U ${DB_USERNAME}", "-d", "${DB_DATABASE:-coolify}" ]
|
||||||
|
interval: 5s
|
||||||
|
retries: 10
|
||||||
|
timeout: 2s
|
||||||
|
redis:
|
||||||
|
command: redis-server --save 20 1 --loglevel warning --requirepass ${REDIS_PASSWORD}
|
||||||
|
environment:
|
||||||
|
REDIS_PASSWORD: "${REDIS_PASSWORD}"
|
||||||
|
volumes:
|
||||||
|
- coolify-redis:/data
|
||||||
|
healthcheck:
|
||||||
|
test: redis-cli ping
|
||||||
|
interval: 5s
|
||||||
|
retries: 10
|
||||||
|
timeout: 2s
|
||||||
|
soketi:
|
||||||
|
image: '${REGISTRY_URL:-ghcr.io}/coollabsio/coolify-realtime:1.0.10'
|
||||||
|
ports:
|
||||||
|
- "${SOKETI_PORT:-6001}:6001"
|
||||||
|
- "6002:6002"
|
||||||
|
volumes:
|
||||||
|
- /data/coolify/ssh:/var/www/html/storage/app/ssh
|
||||||
|
environment:
|
||||||
|
APP_NAME: "${APP_NAME:-Coolify}"
|
||||||
|
SOKETI_DEBUG: "${SOKETI_DEBUG:-false}"
|
||||||
|
SOKETI_DEFAULT_APP_ID: "${PUSHER_APP_ID}"
|
||||||
|
SOKETI_DEFAULT_APP_KEY: "${PUSHER_APP_KEY}"
|
||||||
|
SOKETI_DEFAULT_APP_SECRET: "${PUSHER_APP_SECRET}"
|
||||||
|
healthcheck:
|
||||||
|
test: [ "CMD-SHELL", "wget -qO- http://127.0.0.1:6001/ready && wget -qO- http://127.0.0.1:6002/ready || exit 1" ]
|
||||||
|
interval: 5s
|
||||||
|
retries: 10
|
||||||
|
timeout: 2s
|
||||||
|
|
||||||
|
volumes:
|
||||||
|
coolify-db:
|
||||||
|
name: coolify-db
|
||||||
|
coolify-redis:
|
||||||
|
name: coolify-redis
|
||||||
|
|
||||||
|
networks:
|
||||||
|
coolify:
|
||||||
|
external: true
|
37
coolify/source/docker-compose.yml
Executable file
37
coolify/source/docker-compose.yml
Executable file
@@ -0,0 +1,37 @@
|
|||||||
|
services:
|
||||||
|
coolify:
|
||||||
|
container_name: coolify
|
||||||
|
restart: always
|
||||||
|
working_dir: /var/www/html
|
||||||
|
extra_hosts:
|
||||||
|
- host.docker.internal:host-gateway
|
||||||
|
networks:
|
||||||
|
- coolify
|
||||||
|
depends_on:
|
||||||
|
- postgres
|
||||||
|
- redis
|
||||||
|
- soketi
|
||||||
|
postgres:
|
||||||
|
image: postgres:15-alpine
|
||||||
|
container_name: coolify-db
|
||||||
|
restart: always
|
||||||
|
networks:
|
||||||
|
- coolify
|
||||||
|
redis:
|
||||||
|
image: redis:7-alpine
|
||||||
|
container_name: coolify-redis
|
||||||
|
restart: always
|
||||||
|
networks:
|
||||||
|
- coolify
|
||||||
|
soketi:
|
||||||
|
container_name: coolify-realtime
|
||||||
|
extra_hosts:
|
||||||
|
- host.docker.internal:host-gateway
|
||||||
|
restart: always
|
||||||
|
networks:
|
||||||
|
- coolify
|
||||||
|
networks:
|
||||||
|
coolify:
|
||||||
|
name: coolify
|
||||||
|
driver: bridge
|
||||||
|
external: false
|
72
coolify/source/upgrade.sh
Executable file
72
coolify/source/upgrade.sh
Executable file
@@ -0,0 +1,72 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
## Do not modify this file. You will lose the ability to autoupdate!
|
||||||
|
|
||||||
|
CDN="https://cdn.coollabs.io/coolify"
|
||||||
|
LATEST_IMAGE=${1:-latest}
|
||||||
|
LATEST_HELPER_VERSION=${2:-latest}
|
||||||
|
REGISTRY_URL=${3:-ghcr.io}
|
||||||
|
SKIP_BACKUP=${4:-false}
|
||||||
|
ENV_FILE="/data/coolify/source/.env"
|
||||||
|
|
||||||
|
DATE=$(date +%Y-%m-%d-%H-%M-%S)
|
||||||
|
LOGFILE="/data/coolify/source/upgrade-${DATE}.log"
|
||||||
|
|
||||||
|
curl -fsSL $CDN/docker-compose.yml -o /data/coolify/source/docker-compose.yml
|
||||||
|
curl -fsSL $CDN/docker-compose.prod.yml -o /data/coolify/source/docker-compose.prod.yml
|
||||||
|
curl -fsSL $CDN/.env.production -o /data/coolify/source/.env.production
|
||||||
|
|
||||||
|
# Backup existing .env file before making any changes
|
||||||
|
if [ "$SKIP_BACKUP" != "true" ]; then
|
||||||
|
if [ -f "$ENV_FILE" ]; then
|
||||||
|
echo "Creating backup of existing .env file to .env-$DATE" >>"$LOGFILE"
|
||||||
|
cp "$ENV_FILE" "$ENV_FILE-$DATE"
|
||||||
|
else
|
||||||
|
echo "No existing .env file found to backup" >>"$LOGFILE"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "Merging .env.production values into .env" >>"$LOGFILE"
|
||||||
|
awk -F '=' '!seen[$1]++' "$ENV_FILE" /data/coolify/source/.env.production > "$ENV_FILE.tmp" && mv "$ENV_FILE.tmp" "$ENV_FILE"
|
||||||
|
echo ".env file merged successfully" >>"$LOGFILE"
|
||||||
|
|
||||||
|
update_env_var() {
|
||||||
|
local key="$1"
|
||||||
|
local value="$2"
|
||||||
|
|
||||||
|
# If variable "key=" exists but has no value, update the value of the existing line
|
||||||
|
if grep -q "^${key}=$" "$ENV_FILE"; then
|
||||||
|
sed -i "s|^${key}=$|${key}=${value}|" "$ENV_FILE"
|
||||||
|
echo " - Updated value of ${key} as the current value was empty" >>"$LOGFILE"
|
||||||
|
# If variable "key=" doesn't exist, append it to the file with value
|
||||||
|
elif ! grep -q "^${key}=" "$ENV_FILE"; then
|
||||||
|
printf '%s=%s\n' "$key" "$value" >>"$ENV_FILE"
|
||||||
|
echo " - Added ${key} with default value as the variable was missing" >>"$LOGFILE"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
echo "Checking and updating environment variables if necessary..." >>"$LOGFILE"
|
||||||
|
update_env_var "PUSHER_APP_ID" "$(openssl rand -hex 32)"
|
||||||
|
update_env_var "PUSHER_APP_KEY" "$(openssl rand -hex 32)"
|
||||||
|
update_env_var "PUSHER_APP_SECRET" "$(openssl rand -hex 32)"
|
||||||
|
|
||||||
|
# Make sure coolify network exists
|
||||||
|
# It is created when starting Coolify with docker compose
|
||||||
|
if ! docker network inspect coolify >/dev/null 2>&1; then
|
||||||
|
if ! docker network create --attachable --ipv6 coolify 2>/dev/null; then
|
||||||
|
echo "Failed to create coolify network with ipv6. Trying without ipv6..."
|
||||||
|
docker network create --attachable coolify 2>/dev/null
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Check if Docker config file exists
|
||||||
|
DOCKER_CONFIG_MOUNT=""
|
||||||
|
if [ -f /root/.docker/config.json ]; then
|
||||||
|
DOCKER_CONFIG_MOUNT="-v /root/.docker/config.json:/root/.docker/config.json"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -f /data/coolify/source/docker-compose.custom.yml ]; then
|
||||||
|
echo "docker-compose.custom.yml detected." >>"$LOGFILE"
|
||||||
|
docker run -v /data/coolify/source:/data/coolify/source -v /var/run/docker.sock:/var/run/docker.sock ${DOCKER_CONFIG_MOUNT} --rm ${REGISTRY_URL:-ghcr.io}/coollabsio/coolify-helper:${LATEST_HELPER_VERSION} bash -c "LATEST_IMAGE=${LATEST_IMAGE} docker compose --env-file /data/coolify/source/.env -f /data/coolify/source/docker-compose.yml -f /data/coolify/source/docker-compose.prod.yml -f /data/coolify/source/docker-compose.custom.yml up -d --remove-orphans --force-recreate --wait --wait-timeout 60" >>"$LOGFILE" 2>&1
|
||||||
|
else
|
||||||
|
docker run -v /data/coolify/source:/data/coolify/source -v /var/run/docker.sock:/var/run/docker.sock ${DOCKER_CONFIG_MOUNT} --rm ${REGISTRY_URL:-ghcr.io}/coollabsio/coolify-helper:${LATEST_HELPER_VERSION} bash -c "LATEST_IMAGE=${LATEST_IMAGE} docker compose --env-file /data/coolify/source/.env -f /data/coolify/source/docker-compose.yml -f /data/coolify/source/docker-compose.prod.yml up -d --remove-orphans --force-recreate --wait --wait-timeout 60" >>"$LOGFILE" 2>&1
|
||||||
|
fi
|
7
coolify/ssh/keys/ssh_key@s48ksckws048ww8wcc84gcck
Normal file
7
coolify/ssh/keys/ssh_key@s48ksckws048ww8wcc84gcck
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
-----BEGIN OPENSSH PRIVATE KEY-----
|
||||||
|
b3BlbnNzaC1rZXktdjEAAAAABG5vbmUAAAAEbm9uZQAAAAAAAAABAAAAMwAAAAtzc2gtZW
|
||||||
|
QyNTUxOQAAACA6lYnB/TlvQFbWtV0WRxuDap0aVaI39D0a/Mj6yiZ0/QAAAJDH8TYIx/E2
|
||||||
|
CAAAAAtzc2gtZWQyNTUxOQAAACA6lYnB/TlvQFbWtV0WRxuDap0aVaI39D0a/Mj6yiZ0/Q
|
||||||
|
AAAEBPb2drVu29JMGyeO+zZMWlSKbrwBqhxiEIxqhJu88bHjqVicH9OW9AVta1XRZHG4Nq
|
||||||
|
nRpVojf0PRr8yPrKJnT9AAAAB2Nvb2xpZnkBAgMEBQY=
|
||||||
|
-----END OPENSSH PRIVATE KEY-----
|
16
coolify/ssl/coolify-ca.crt
Normal file
16
coolify/ssl/coolify-ca.crt
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
-----BEGIN CERTIFICATE-----
|
||||||
|
MIICZzCCAcigAwIBAgIIUFnLpdZYJPcwCgYIKoZIzj0EAwQwUjEfMB0GA1UEAwwW
|
||||||
|
Q29vbGlmeSBDQSBDZXJ0aWZpY2F0ZTEQMA4GA1UECgwHQ29vbGlmeTELMAkGA1UE
|
||||||
|
BhMCWFgxEDAOBgNVBAgMB0RlZmF1bHQwHhcNMjUxMDA5MTkxNTE4WhcNMzUxMDA3
|
||||||
|
MTkxNTE4WjBSMR8wHQYDVQQDDBZDb29saWZ5IENBIENlcnRpZmljYXRlMRAwDgYD
|
||||||
|
VQQKDAdDb29saWZ5MQswCQYDVQQGEwJYWDEQMA4GA1UECAwHRGVmYXVsdDCBmzAQ
|
||||||
|
BgcqhkjOPQIBBgUrgQQAIwOBhgAEABrPbG66m98V6a9MoCgUuAGbfJEXxUsIpSgM
|
||||||
|
KtZyhL038tn3R6tCG25Ko+qQmjNce+LTlXXsABPf1PSTtkB/FFaqADGjrp5N+73H
|
||||||
|
u6QfPKn+0lDDGXboQNFERCuM+bblPN/eRwDb5IwO677KjMJFlZ7lAF4bcM/QHwya
|
||||||
|
Bj/AZG9JCWhho0UwQzASBgNVHRMBAf8ECDAGAQH/AgEAMA4GA1UdDwEB/wQEAwIB
|
||||||
|
BjAdBgNVHQ4EFgQUXTqUMtoLFG6RN+7Ugdr/7ZhRFTswCgYIKoZIzj0EAwQDgYwA
|
||||||
|
MIGIAkIBZhZHJ8Co6pQ4FNTWivtDVIC04k4vXKVOeDJ1hHiZlxY0tvRLpK5iI5ys
|
||||||
|
HWoglW4XrnP1tYwZITaloGH2lQIu/OwCQgDwPjyzLIZdPocUvGqLIH/prCjpi8OR
|
||||||
|
pu5hw0FeqNbzuLdUElvSd2tpO+g9A0c0UQxlzmS2La5LJkPjkT0iUuqNdA==
|
||||||
|
-----END CERTIFICATE-----
|
||||||
|
|
Reference in New Issue
Block a user