mirror of
https://github.com/Dokploy/dokploy
synced 2025-06-26 18:27:59 +00:00
fix: ENV Testing
This commit is contained in:
@@ -18,21 +18,31 @@ services:
|
|||||||
- AP_POSTGRES_USERNAME=${AP_POSTGRES_USERNAME}
|
- AP_POSTGRES_USERNAME=${AP_POSTGRES_USERNAME}
|
||||||
- AP_POSTGRES_HOST=postgres
|
- AP_POSTGRES_HOST=postgres
|
||||||
- AP_POSTGRES_PORT=5432
|
- AP_POSTGRES_PORT=5432
|
||||||
|
- AP_POSTGRES_USE_SSL=false
|
||||||
- AP_QUEUE_MODE=REDIS
|
- AP_QUEUE_MODE=REDIS
|
||||||
- AP_REDIS_HOST=redis
|
- AP_REDIS_HOST=redis
|
||||||
- AP_REDIS_PORT=6379
|
- AP_REDIS_PORT=6379
|
||||||
- AP_REDIS_PASSWORD=${REDIS_PASSWORD}
|
- AP_REDIS_PASSWORD=${AP_REDIS_PASSWORD}
|
||||||
|
- AP_REDIS_DB=0
|
||||||
|
- AP_REDIS_USE_SSL=false
|
||||||
- AP_ENVIRONMENT=prod
|
- AP_ENVIRONMENT=prod
|
||||||
- AP_FRONTEND_URL=https://${AP_HOST}
|
- AP_FRONTEND_URL=https://${AP_HOST}
|
||||||
- AP_ENCRYPTION_KEY=${AP_ENCRYPTION_KEY}
|
- AP_ENCRYPTION_KEY=${AP_ENCRYPTION_KEY}
|
||||||
- AP_JWT_SECRET=${AP_JWT_SECRET}
|
- AP_JWT_SECRET=${AP_JWT_SECRET}
|
||||||
- AP_ENGINE_EXECUTABLE_PATH=dist/packages/engine/main.js
|
- AP_ENGINE_EXECUTABLE_PATH=dist/packages/engine/main.js
|
||||||
- AP_EXECUTION_MODE=UNSANDBOXED
|
- AP_EXECUTION_MODE=UNSANDBOXED
|
||||||
|
- AP_FLOW_WORKER_CONCURRENCY=10
|
||||||
|
- AP_SCHEDULED_WORKER_CONCURRENCY=10
|
||||||
|
- AP_TELEMETRY_ENABLED=false
|
||||||
|
- AP_PIECES_SOURCE=DB
|
||||||
|
- AP_PIECES_SYNC_MODE=OFFICIAL_AUTO
|
||||||
- AP_WEBHOOK_TIMEOUT_SECONDS=30
|
- AP_WEBHOOK_TIMEOUT_SECONDS=30
|
||||||
- AP_TRIGGER_DEFAULT_POLL_INTERVAL=5
|
- AP_TRIGGER_DEFAULT_POLL_INTERVAL=5
|
||||||
- AP_FLOW_TIMEOUT_SECONDS=600
|
- AP_FLOW_TIMEOUT_SECONDS=600
|
||||||
- AP_TELEMETRY_ENABLED=true
|
- AP_EXECUTION_DATA_RETENTION_DAYS=30
|
||||||
- AP_TEMPLATES_SOURCE_URL=https://cloud.activepieces.com/api/v1/flow-templates
|
- AP_PROJECT_RATE_LIMITER_ENABLED=true
|
||||||
|
- AP_MAX_CONCURRENT_JOBS_PER_PROJECT=100
|
||||||
|
- AP_FILE_STORAGE_LOCATION=DB
|
||||||
|
|
||||||
postgres:
|
postgres:
|
||||||
image: postgres:14.4
|
image: postgres:14.4
|
||||||
@@ -53,13 +63,13 @@ services:
|
|||||||
|
|
||||||
redis:
|
redis:
|
||||||
image: redis:7.0.7
|
image: redis:7.0.7
|
||||||
command: redis-server --requirepass ${REDIS_PASSWORD}
|
command: redis-server --requirepass ${AP_REDIS_PASSWORD}
|
||||||
networks:
|
networks:
|
||||||
- dokploy-network
|
- dokploy-network
|
||||||
volumes:
|
volumes:
|
||||||
- redis_data:/data
|
- redis_data:/data
|
||||||
healthcheck:
|
healthcheck:
|
||||||
test: ["CMD", "redis-cli", "-a", "${REDIS_PASSWORD}", "ping"]
|
test: ["CMD", "redis-cli", "-a", "${AP_REDIS_PASSWORD}", "ping"]
|
||||||
interval: 10s
|
interval: 10s
|
||||||
timeout: 5s
|
timeout: 5s
|
||||||
retries: 5
|
retries: 5
|
||||||
|
|||||||
@@ -9,18 +9,16 @@ import {
|
|||||||
export function generate(schema: Schema): Template {
|
export function generate(schema: Schema): Template {
|
||||||
const mainDomain = generateRandomDomain(schema);
|
const mainDomain = generateRandomDomain(schema);
|
||||||
|
|
||||||
const apiKey = Array.from({length: 64}, () =>
|
const encryptionKey = Array.from({length: 16}, () =>
|
||||||
Math.floor(Math.random() * 16).toString(16)).join('');
|
|
||||||
const postgresPassword = Array.from({length: 32}, () =>
|
|
||||||
Math.floor(Math.random() * 16).toString(16)).join('');
|
Math.floor(Math.random() * 16).toString(16)).join('');
|
||||||
const jwtSecret = Array.from({length: 32}, () =>
|
const jwtSecret = Array.from({length: 32}, () =>
|
||||||
Math.floor(Math.random() * 16).toString(16)).join('');
|
Math.floor(Math.random() * 16).toString(16)).join('');
|
||||||
const encryptionKey = Array.from({length: 16}, () =>
|
const postgresPassword = Array.from({length: 32}, () =>
|
||||||
Math.floor(Math.random() * 16).toString(16)).join('');
|
Math.floor(Math.random() * 16).toString(16)).join('');
|
||||||
|
const redisPassword = generateBase64(32);
|
||||||
|
|
||||||
const postgresUser = "activepieces";
|
const postgresUser = "activepieces";
|
||||||
const postgresDb = "activepieces";
|
const postgresDb = "activepieces";
|
||||||
const redisPassword = generateBase64(24);
|
|
||||||
|
|
||||||
const domains: DomainSchema[] = [
|
const domains: DomainSchema[] = [
|
||||||
{
|
{
|
||||||
@@ -31,14 +29,14 @@ export function generate(schema: Schema): Template {
|
|||||||
];
|
];
|
||||||
|
|
||||||
const envs = [
|
const envs = [
|
||||||
|
`AP_HOST=${mainDomain}`,
|
||||||
|
`AP_FRONTEND_URL=https://${mainDomain}`,
|
||||||
|
`AP_ENCRYPTION_KEY=${encryptionKey}`,
|
||||||
|
`AP_JWT_SECRET=${jwtSecret}`,
|
||||||
`AP_POSTGRES_DATABASE=${postgresDb}`,
|
`AP_POSTGRES_DATABASE=${postgresDb}`,
|
||||||
`AP_POSTGRES_PASSWORD=${postgresPassword}`,
|
`AP_POSTGRES_PASSWORD=${postgresPassword}`,
|
||||||
`AP_POSTGRES_USERNAME=${postgresUser}`,
|
`AP_POSTGRES_USERNAME=${postgresUser}`,
|
||||||
`AP_HOST=${mainDomain}`,
|
`AP_REDIS_PASSWORD=${redisPassword}`,
|
||||||
`AP_API_KEY=${apiKey}`,
|
|
||||||
`AP_ENCRYPTION_KEY=${encryptionKey}`,
|
|
||||||
`AP_JWT_SECRET=${jwtSecret}`,
|
|
||||||
`REDIS_PASSWORD=${redisPassword}`,
|
|
||||||
];
|
];
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
|||||||
@@ -48,7 +48,7 @@ services:
|
|||||||
- FRONTEND_URL=http://${CHATWOOT_HOST}
|
- FRONTEND_URL=http://${CHATWOOT_HOST}
|
||||||
- SECRET_KEY_BASE=${SECRET_KEY_BASE}
|
- SECRET_KEY_BASE=${SECRET_KEY_BASE}
|
||||||
- POSTGRES_HOST=postgres
|
- POSTGRES_HOST=postgres
|
||||||
- POSTGRES_USERNAME=${POSTGRES_USERNAME}
|
- POSTGRES_USERNAME=postgres
|
||||||
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
|
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
|
||||||
- POSTGRES_DATABASE=chatwoot_production
|
- POSTGRES_DATABASE=chatwoot_production
|
||||||
- REDIS_URL=redis://redis:6379
|
- REDIS_URL=redis://redis:6379
|
||||||
@@ -56,12 +56,9 @@ services:
|
|||||||
- ENABLE_ACCOUNT_SIGNUP=false
|
- ENABLE_ACCOUNT_SIGNUP=false
|
||||||
- FORCE_SSL=false
|
- FORCE_SSL=false
|
||||||
- RAILS_LOG_TO_STDOUT=true
|
- RAILS_LOG_TO_STDOUT=true
|
||||||
- LOG_LEVEL=info
|
|
||||||
- LOG_SIZE=500
|
|
||||||
- RAILS_MAX_THREADS=5
|
|
||||||
command: >
|
command: >
|
||||||
sh -c "
|
sh -c "
|
||||||
until PGPASSWORD=${POSTGRES_PASSWORD} psql -h postgres -U ${POSTGRES_USERNAME} -d chatwoot_production -c '\q'; do
|
until PGPASSWORD=${POSTGRES_PASSWORD} psql -h postgres -U postgres -d chatwoot_production -c '\q'; do
|
||||||
echo 'Waiting for postgres...'
|
echo 'Waiting for postgres...'
|
||||||
sleep 5
|
sleep 5
|
||||||
done
|
done
|
||||||
@@ -90,25 +87,14 @@ services:
|
|||||||
- FRONTEND_URL=http://${CHATWOOT_HOST}
|
- FRONTEND_URL=http://${CHATWOOT_HOST}
|
||||||
- SECRET_KEY_BASE=${SECRET_KEY_BASE}
|
- SECRET_KEY_BASE=${SECRET_KEY_BASE}
|
||||||
- POSTGRES_HOST=postgres
|
- POSTGRES_HOST=postgres
|
||||||
- POSTGRES_USERNAME=${POSTGRES_USERNAME}
|
- POSTGRES_USERNAME=postgres
|
||||||
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
|
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
|
||||||
- POSTGRES_DATABASE=chatwoot_production
|
- POSTGRES_DATABASE=chatwoot_production
|
||||||
- REDIS_URL=redis://redis:6379
|
- REDIS_URL=redis://redis:6379
|
||||||
- REDIS_PASSWORD=${REDIS_PASSWORD}
|
- REDIS_PASSWORD=${REDIS_PASSWORD}
|
||||||
- ENABLE_ACCOUNT_SIGNUP=false
|
- ENABLE_ACCOUNT_SIGNUP=false
|
||||||
- MAILER_SENDER_EMAIL=Chatwoot <no-reply@${CHATWOOT_HOST}>
|
|
||||||
- FORCE_SSL=false
|
- FORCE_SSL=false
|
||||||
- RAILS_LOG_TO_STDOUT=true
|
- RAILS_LOG_TO_STDOUT=true
|
||||||
- LOG_LEVEL=info
|
|
||||||
- LOG_SIZE=500
|
|
||||||
- RAILS_MAX_THREADS=5
|
|
||||||
- SMTP_DOMAIN=${CHATWOOT_HOST}
|
|
||||||
- SMTP_ADDRESS=${SMTP_ADDRESS}
|
|
||||||
- SMTP_PORT=${SMTP_PORT}
|
|
||||||
- SMTP_USERNAME=${SMTP_USERNAME}
|
|
||||||
- SMTP_PASSWORD=${SMTP_PASSWORD}
|
|
||||||
- SMTP_AUTHENTICATION=plain
|
|
||||||
- SMTP_ENABLE_STARTTLS_AUTO=true
|
|
||||||
entrypoint: docker/entrypoints/rails.sh
|
entrypoint: docker/entrypoints/rails.sh
|
||||||
command: ['bundle', 'exec', 'rails', 's', '-p', '3000', '-b', '0.0.0.0']
|
command: ['bundle', 'exec', 'rails', 's', '-p', '3000', '-b', '0.0.0.0']
|
||||||
restart: always
|
restart: always
|
||||||
@@ -127,24 +113,13 @@ services:
|
|||||||
- FRONTEND_URL=http://${CHATWOOT_HOST}
|
- FRONTEND_URL=http://${CHATWOOT_HOST}
|
||||||
- SECRET_KEY_BASE=${SECRET_KEY_BASE}
|
- SECRET_KEY_BASE=${SECRET_KEY_BASE}
|
||||||
- POSTGRES_HOST=postgres
|
- POSTGRES_HOST=postgres
|
||||||
- POSTGRES_USERNAME=${POSTGRES_USERNAME}
|
- POSTGRES_USERNAME=postgres
|
||||||
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
|
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
|
||||||
- POSTGRES_DATABASE=chatwoot_production
|
- POSTGRES_DATABASE=chatwoot_production
|
||||||
- REDIS_URL=redis://redis:6379
|
- REDIS_URL=redis://redis:6379
|
||||||
- REDIS_PASSWORD=${REDIS_PASSWORD}
|
- REDIS_PASSWORD=${REDIS_PASSWORD}
|
||||||
- FORCE_SSL=false
|
- FORCE_SSL=false
|
||||||
- RAILS_LOG_TO_STDOUT=true
|
- RAILS_LOG_TO_STDOUT=true
|
||||||
- LOG_LEVEL=info
|
|
||||||
- LOG_SIZE=500
|
|
||||||
- RAILS_MAX_THREADS=5
|
|
||||||
- SMTP_DOMAIN=${CHATWOOT_HOST}
|
|
||||||
- SMTP_ADDRESS=${SMTP_ADDRESS}
|
|
||||||
- SMTP_PORT=${SMTP_PORT}
|
|
||||||
- SMTP_USERNAME=${SMTP_USERNAME}
|
|
||||||
- SMTP_PASSWORD=${SMTP_PASSWORD}
|
|
||||||
- SMTP_AUTHENTICATION=plain
|
|
||||||
- SMTP_ENABLE_STARTTLS_AUTO=true
|
|
||||||
- MAILER_SENDER_EMAIL=Chatwoot <no-reply@${CHATWOOT_HOST}>
|
|
||||||
command: ['bundle', 'exec', 'sidekiq', '-C', 'config/sidekiq.yml']
|
command: ['bundle', 'exec', 'sidekiq', '-C', 'config/sidekiq.yml']
|
||||||
restart: always
|
restart: always
|
||||||
|
|
||||||
|
|||||||
@@ -27,11 +27,11 @@ export function generate(schema: Schema): Template {
|
|||||||
const mounts: Template["mounts"] = [
|
const mounts: Template["mounts"] = [
|
||||||
{
|
{
|
||||||
filePath: "Caddyfile",
|
filePath: "Caddyfile",
|
||||||
content: `{$BASE_URL} {
|
content: `:80 {
|
||||||
bind {$ADDRESS}
|
bind 0.0.0.0
|
||||||
reverse_proxy /ws/* http://lsp:3001
|
reverse_proxy /ws/* http://lsp:3001
|
||||||
reverse_proxy /* http://windmill_server:8000
|
reverse_proxy /* http://windmill_server:8000
|
||||||
}`
|
}`,
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user