fix: parser
This commit is contained in:
@@ -3286,15 +3286,17 @@ function newParser(Application|Service $resource, int $pull_request_id = 0, ?int
|
||||
$value = $fqdn;
|
||||
}
|
||||
if (! $isDatabase) {
|
||||
if ($isApplication && is_null($resource->fqdn)) {
|
||||
data_forget($resource, 'environment_variables');
|
||||
data_forget($resource, 'environment_variables_preview');
|
||||
$resource->fqdn = $value;
|
||||
$resource->save();
|
||||
} elseif ($isService && is_null($savedService->fqdn)) {
|
||||
if ($key->startsWith('SERVICE_FQDN_')) {
|
||||
$savedService->fqdn = $value;
|
||||
$savedService->save();
|
||||
if ($key->startsWith('SERVICE_FQDN_') && ($originalValue->value() === '' || $originalValue->startsWith('/'))) {
|
||||
if ($isApplication && is_null($resource->fqdn)) {
|
||||
data_forget($resource, 'environment_variables');
|
||||
data_forget($resource, 'environment_variables_preview');
|
||||
$resource->fqdn = $value;
|
||||
$resource->save();
|
||||
} elseif ($isService && is_null($savedService->fqdn)) {
|
||||
if ($key->startsWith('SERVICE_FQDN_')) {
|
||||
$savedService->fqdn = $value;
|
||||
$savedService->save();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -87,40 +87,116 @@ networks:
|
||||
'pull_request_html_url' => 'https://github.com/coollabsio/coolify-examples/pull/1',
|
||||
]);
|
||||
$this->serviceYaml = '
|
||||
version: "3.8"
|
||||
services:
|
||||
app:
|
||||
image: nginx
|
||||
environment:
|
||||
SERVICE_FQDN_APP: /app
|
||||
APP_KEY: base64
|
||||
APP_DEBUG: "${APP_DEBUG:-false}"
|
||||
APP_URL: $SERVICE_FQDN_APP
|
||||
DB_URL: postgres://${SERVICE_USER_POSTGRES}:${SERVICE_PASSWORD_POSTGRES}@db:5432/postgres?schema=public
|
||||
volumes:
|
||||
- "./nginx:/etc/nginx"
|
||||
- "data:/var/www/html"
|
||||
chatwoot:
|
||||
image: chatwoot/chatwoot:latest
|
||||
depends_on:
|
||||
- db
|
||||
db:
|
||||
image: postgres
|
||||
- postgres
|
||||
- redis
|
||||
environment:
|
||||
POSTGRES_USER: "${SERVICE_USER_POSTGRES}"
|
||||
POSTGRES_PASSWORD: "${SERVICE_PASSWORD_POSTGRES}"
|
||||
- SERVICE_FQDN_CHATWOOT_3000
|
||||
- SECRET_KEY_BASE=$SERVICE_PASSWORD_CHATWOOT
|
||||
- FRONTEND_URL=${SERVICE_FQDN_CHATWOOT}
|
||||
- DEFAULT_LOCALE=${CHATWOOT_DEFAULT_LOCALE}
|
||||
- FORCE_SSL=false
|
||||
- ENABLE_ACCOUNT_SIGNUP=false
|
||||
- REDIS_URL=redis://default@redis:6379
|
||||
- REDIS_PASSWORD=$SERVICE_PASSWORD_REDIS
|
||||
- REDIS_OPENSSL_VERIFY_MODE=none
|
||||
- POSTGRES_DATABASE=chatwoot
|
||||
- POSTGRES_HOST=postgres
|
||||
- POSTGRES_USERNAME=$SERVICE_USER_POSTGRES_USER
|
||||
- POSTGRES_PASSWORD=$SERVICE_PASSWORD_POSTGRES
|
||||
- RAILS_MAX_THREADS=5
|
||||
- NODE_ENV=production
|
||||
- RAILS_ENV=production
|
||||
- INSTALLATION_ENV=docker
|
||||
- MAILER_SENDER_EMAIL=${CHATWOOT_MAILER_SENDER_EMAIL}
|
||||
- SMTP_ADDRESS=${CHATWOOT_SMTP_ADDRESS}
|
||||
- SMTP_AUTHENTICATION=${CHATWOOT_SMTP_AUTHENTICATION}
|
||||
- SMTP_DOMAIN=${CHATWOOT_SMTP_DOMAIN}
|
||||
- SMTP_ENABLE_STARTTLS_AUTO=${CHATWOOT_SMTP_ENABLE_STARTTLS_AUTO}
|
||||
- SMTP_PORT=${CHATWOOT_SMTP_PORT}
|
||||
- SMTP_USERNAME=${CHATWOOT_SMTP_USERNAME}
|
||||
- SMTP_PASSWORD=${CHATWOOT_SMTP_PASSWORD}
|
||||
- ACTIVE_STORAGE_SERVICE=local
|
||||
entrypoint: docker/entrypoints/rails.sh
|
||||
command: sh -c "bundle exec rails db:chatwoot_prepare && bundle exec rails s -p 3000 -b 0.0.0.0"
|
||||
volumes:
|
||||
- "dbdata:/var/lib/postgresql/data"
|
||||
- rails-data:/app/storage
|
||||
healthcheck:
|
||||
test:
|
||||
- CMD
|
||||
- pg_isready
|
||||
- "-U"
|
||||
- "postgres"
|
||||
interval: 2s
|
||||
timeout: 10s
|
||||
test: ["CMD", "wget", "--spider", "-q", "http://127.0.0.1:3000"]
|
||||
interval: 5s
|
||||
timeout: 20s
|
||||
retries: 10
|
||||
|
||||
sidekiq:
|
||||
image: chatwoot/chatwoot:latest
|
||||
depends_on:
|
||||
app:
|
||||
condition: service_healthy
|
||||
- postgres
|
||||
- redis
|
||||
environment:
|
||||
- SECRET_KEY_BASE=$SERVICE_PASSWORD_CHATWOOT
|
||||
- FRONTEND_URL=${SERVICE_FQDN_CHATWOOT}
|
||||
- DEFAULT_LOCALE=${CHATWOOT_DEFAULT_LOCALE}
|
||||
- FORCE_SSL=false
|
||||
- ENABLE_ACCOUNT_SIGNUP=false
|
||||
- REDIS_URL=redis://default@redis:6379
|
||||
- REDIS_PASSWORD=$SERVICE_PASSWORD_REDIS
|
||||
- REDIS_OPENSSL_VERIFY_MODE=none
|
||||
- POSTGRES_DATABASE=chatwoot
|
||||
- POSTGRES_HOST=postgres
|
||||
- POSTGRES_USERNAME=$SERVICE_USER_POSTGRES_USER
|
||||
- POSTGRES_PASSWORD=$SERVICE_PASSWORD_POSTGRES
|
||||
- RAILS_MAX_THREADS=5
|
||||
- NODE_ENV=production
|
||||
- RAILS_ENV=production
|
||||
- INSTALLATION_ENV=docker
|
||||
- MAILER_SENDER_EMAIL=${CHATWOOT_MAILER_SENDER_EMAIL}
|
||||
- SMTP_ADDRESS=${CHATWOOT_SMTP_ADDRESS}
|
||||
- SMTP_AUTHENTICATION=${CHATWOOT_SMTP_AUTHENTICATION}
|
||||
- SMTP_DOMAIN=${CHATWOOT_SMTP_DOMAIN}
|
||||
- SMTP_ENABLE_STARTTLS_AUTO=${CHATWOOT_SMTP_ENABLE_STARTTLS_AUTO}
|
||||
- SMTP_PORT=${CHATWOOT_SMTP_PORT}
|
||||
- SMTP_USERNAME=${CHATWOOT_SMTP_USERNAME}
|
||||
- SMTP_PASSWORD=${CHATWOOT_SMTP_PASSWORD}
|
||||
- ACTIVE_STORAGE_SERVICE=local
|
||||
command: ["bundle", "exec", "sidekiq", "-C", "config/sidekiq.yml"]
|
||||
volumes:
|
||||
- sidekiq-data:/app/storage
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", "bundle exec rails runner \'puts Sidekiq.redis(&:info)\' > /dev/null 2>&1"]
|
||||
interval: 30s
|
||||
timeout: 10s
|
||||
retries: 3
|
||||
|
||||
postgres:
|
||||
image: postgres:12
|
||||
restart: always
|
||||
volumes:
|
||||
- postgres-data:/var/lib/postgresql/data
|
||||
environment:
|
||||
- POSTGRES_DB=chatwoot
|
||||
- POSTGRES_USER=$SERVICE_USER_POSTGRES_USER
|
||||
- POSTGRES_PASSWORD=$SERVICE_PASSWORD_POSTGRES
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", "pg_isready -U $SERVICE_USER_POSTGRES_USER -d chatwoot -h 127.0.0.1"]
|
||||
interval: 30s
|
||||
timeout: 10s
|
||||
retries: 5
|
||||
|
||||
redis:
|
||||
image: redis:alpine
|
||||
restart: always
|
||||
command: ["sh", "-c", "redis-server --requirepass \"$SERVICE_PASSWORD_REDIS\""]
|
||||
volumes:
|
||||
- redis-data:/data
|
||||
healthcheck:
|
||||
test: ["CMD", "redis-cli", "-a", "$SERVICE_PASSWORD_REDIS", "PING"]
|
||||
interval: 30s
|
||||
timeout: 10s
|
||||
retries: 5
|
||||
|
||||
';
|
||||
|
||||
$this->serviceComposeFileString = Yaml::parse($this->serviceYaml);
|
||||
|
Reference in New Issue
Block a user