From bff3cd11d823a94531b5eafa2c991fffa4de78a1 Mon Sep 17 00:00:00 2001 From: Cristopher Caamana Date: Mon, 11 Nov 2024 13:54:59 +0000 Subject: [PATCH 1/2] Added Appwrite Template --- .../templates/appwrite/docker-compose.yml | 801 ++++++++++++++++++ apps/dokploy/templates/appwrite/index.ts | 128 +++ apps/dokploy/templates/templates.ts | 15 + 3 files changed, 944 insertions(+) create mode 100644 apps/dokploy/templates/appwrite/docker-compose.yml create mode 100644 apps/dokploy/templates/appwrite/index.ts diff --git a/apps/dokploy/templates/appwrite/docker-compose.yml b/apps/dokploy/templates/appwrite/docker-compose.yml new file mode 100644 index 000000000..624ce5f48 --- /dev/null +++ b/apps/dokploy/templates/appwrite/docker-compose.yml @@ -0,0 +1,801 @@ +# Usage +# CHECK all the environment variables that you'll need. +# Replace YOUR_DOMAIN_HERE and YOUR_FUNCTION_DOMAIN_HERE in this docker compose file and in the environmente variables +# If you need Clamav, uncomment the lines required below +# Note: Updates needs to be tested/adjusted properly - See Appwrite docs about updating (https://appwrite.io/docs/advanced/self-hosting/update) + +x-logging: &a1 + logging: + driver: json-file + options: + max-file: "5" + max-size: 10m +services: + appwrite: + image: appwrite/appwrite:1.6.0 + <<: *a1 + restart: unless-stopped + networks: + - dokploy-network + labels: + - traefik.enable=true + - traefik.http.services.appwrite_api.loadbalancer.server.port=80 + + - traefik.http.routers.awmain.rule=Host(`YOUR_DOMAIN_HERE`) && !PathPrefix(`/console`) && !PathPrefix(`/v1/realtime`) + - traefik.http.routers.awmain.entrypoints=web,websecure + - traefik.http.routers.awmain.tls=true + - traefik.http.routers.awmain.tls.certresolver=letsencrypt + - traefik.http.routers.awmain.service=appwrite_api + + - traefik.http.routers.awserverf.rule=Host(`YOUR_FUNCTION_DOMAIN_HERE`) + - traefik.http.routers.awserverf.entrypoints=web,websecure + - traefik.http.routers.awserverf.tls=true + - traefik.http.routers.awserverf.tls.certresolver=letsencrypt + - traefik.http.routers.awserverf.service=appwrite_api + volumes: + - appwrite-uploads:/storage/uploads:rw + - appwrite-cache:/storage/cache:rw + - appwrite-config:/storage/config:rw + - appwrite-certificates:/storage/certificates:rw + - appwrite-functions:/storage/functions:rw + depends_on: + - mariadb + - redis + # - clamav + environment: + - _APP_ENV + - _APP_WORKER_PER_CORE + - _APP_LOCALE + - _APP_CONSOLE_WHITELIST_ROOT + - _APP_CONSOLE_WHITELIST_EMAILS + - _APP_CONSOLE_SESSION_ALERTS + - _APP_CONSOLE_WHITELIST_IPS + - _APP_CONSOLE_HOSTNAMES + - _APP_SYSTEM_EMAIL_NAME + - _APP_SYSTEM_EMAIL_ADDRESS + - _APP_EMAIL_SECURITY + - _APP_SYSTEM_RESPONSE_FORMAT + - _APP_OPTIONS_ABUSE + - _APP_OPTIONS_ROUTER_PROTECTION + - _APP_OPTIONS_FORCE_HTTPS + - _APP_OPTIONS_FUNCTIONS_FORCE_HTTPS + - _APP_OPENSSL_KEY_V1 + - _APP_DOMAIN + - _APP_DOMAIN_TARGET + - _APP_DOMAIN_FUNCTIONS + - _APP_REDIS_HOST + - _APP_REDIS_PORT + - _APP_REDIS_USER + - _APP_REDIS_PASS + - _APP_DB_HOST + - _APP_DB_PORT + - _APP_DB_SCHEMA + - _APP_DB_USER + - _APP_DB_PASS + - _APP_SMTP_HOST + - _APP_SMTP_PORT + - _APP_SMTP_SECURE + - _APP_SMTP_USERNAME + - _APP_SMTP_PASSWORD + - _APP_USAGE_STATS + - _APP_STORAGE_LIMIT + - _APP_STORAGE_PREVIEW_LIMIT + - _APP_STORAGE_ANTIVIRUS + - _APP_STORAGE_ANTIVIRUS_HOST + - _APP_STORAGE_ANTIVIRUS_PORT + - _APP_STORAGE_DEVICE + - _APP_STORAGE_S3_ACCESS_KEY + - _APP_STORAGE_S3_SECRET + - _APP_STORAGE_S3_REGION + - _APP_STORAGE_S3_BUCKET + - _APP_STORAGE_DO_SPACES_ACCESS_KEY + - _APP_STORAGE_DO_SPACES_SECRET + - _APP_STORAGE_DO_SPACES_REGION + - _APP_STORAGE_DO_SPACES_BUCKET + - _APP_STORAGE_BACKBLAZE_ACCESS_KEY + - _APP_STORAGE_BACKBLAZE_SECRET + - _APP_STORAGE_BACKBLAZE_REGION + - _APP_STORAGE_BACKBLAZE_BUCKET + - _APP_STORAGE_LINODE_ACCESS_KEY + - _APP_STORAGE_LINODE_SECRET + - _APP_STORAGE_LINODE_REGION + - _APP_STORAGE_LINODE_BUCKET + - _APP_STORAGE_WASABI_ACCESS_KEY + - _APP_STORAGE_WASABI_SECRET + - _APP_STORAGE_WASABI_REGION + - _APP_STORAGE_WASABI_BUCKET + - _APP_FUNCTIONS_SIZE_LIMIT + - _APP_FUNCTIONS_TIMEOUT + - _APP_FUNCTIONS_BUILD_TIMEOUT + - _APP_FUNCTIONS_CPUS + - _APP_FUNCTIONS_MEMORY + - _APP_FUNCTIONS_RUNTIMES + - _APP_EXECUTOR_SECRET + - _APP_EXECUTOR_HOST + - _APP_LOGGING_CONFIG + - _APP_MAINTENANCE_INTERVAL + - _APP_MAINTENANCE_DELAY + - _APP_MAINTENANCE_RETENTION_EXECUTION + - _APP_MAINTENANCE_RETENTION_CACHE + - _APP_MAINTENANCE_RETENTION_ABUSE + - _APP_MAINTENANCE_RETENTION_AUDIT + - _APP_MAINTENANCE_RETENTION_USAGE_HOURLY + - _APP_MAINTENANCE_RETENTION_SCHEDULES + - _APP_SMS_PROVIDER + - _APP_SMS_FROM + - _APP_GRAPHQL_MAX_BATCH_SIZE + - _APP_GRAPHQL_MAX_COMPLEXITY + - _APP_GRAPHQL_MAX_DEPTH + - _APP_VCS_GITHUB_APP_NAME + - _APP_VCS_GITHUB_PRIVATE_KEY + - _APP_VCS_GITHUB_APP_ID + - _APP_VCS_GITHUB_WEBHOOK_SECRET + - _APP_VCS_GITHUB_CLIENT_SECRET + - _APP_VCS_GITHUB_CLIENT_ID + - _APP_MIGRATIONS_FIREBASE_CLIENT_ID + - _APP_MIGRATIONS_FIREBASE_CLIENT_SECRET + - _APP_ASSISTANT_OPENAI_API_KEY + appwrite-console: + <<: *a1 + image: appwrite/console:5.0.12 + restart: unless-stopped + networks: + - dokploy-network + labels: + - traefik.enable=true + - traefik.http.routers.appwrite_console.rule=Host(`YOUR_DOMAIN_HERE`) && PathPrefix(`/console`) + - traefik.http.routers.appwrite_console.entrypoints=web,websecure + - traefik.http.routers.appwrite_console.tls.certResolver=letsencrypt + - traefik.http.services.appwrite_console.loadbalancer.server.port=80 + appwrite-realtime: + image: appwrite/appwrite:1.6.0 + entrypoint: realtime + <<: *a1 + restart: unless-stopped + labels: + - traefik.enable=true + - traefik.http.routers.appwrite_realtime.rule=Host(`YOUR_DOMAIN_HERE`) && PathPrefix(`/v1/realtime`) + - traefik.http.routers.appwrite_realtime.entrypoints=web,websecure + - traefik.http.routers.appwrite_realtime.tls.certResolver=letsencrypt + - traefik.http.services.appwrite_realtime.loadbalancer.server.port=80 + networks: + - dokploy-network + depends_on: + - mariadb + - redis + environment: + - _APP_ENV + - _APP_WORKER_PER_CORE + - _APP_OPTIONS_ABUSE + - _APP_OPTIONS_ROUTER_PROTECTION + - _APP_OPENSSL_KEY_V1 + - _APP_REDIS_HOST + - _APP_REDIS_PORT + - _APP_REDIS_USER + - _APP_REDIS_PASS + - _APP_DB_HOST + - _APP_DB_PORT + - _APP_DB_SCHEMA + - _APP_DB_USER + - _APP_DB_PASS + - _APP_USAGE_STATS + - _APP_LOGGING_CONFIG + appwrite-worker-audits: + image: appwrite/appwrite:1.6.0 + entrypoint: worker-audits + <<: *a1 + restart: unless-stopped + networks: + - dokploy-network + depends_on: + - redis + - mariadb + environment: + - _APP_ENV + - _APP_WORKER_PER_CORE + - _APP_OPENSSL_KEY_V1 + - _APP_REDIS_HOST + - _APP_REDIS_PORT + - _APP_REDIS_USER + - _APP_REDIS_PASS + - _APP_DB_HOST + - _APP_DB_PORT + - _APP_DB_SCHEMA + - _APP_DB_USER + - _APP_DB_PASS + - _APP_LOGGING_CONFIG + appwrite-worker-webhooks: + image: appwrite/appwrite:1.6.0 + entrypoint: worker-webhooks + <<: *a1 + restart: unless-stopped + networks: + - dokploy-network + depends_on: + - redis + - mariadb + environment: + - _APP_ENV + - _APP_WORKER_PER_CORE + - _APP_OPENSSL_KEY_V1 + - _APP_EMAIL_SECURITY + - _APP_SYSTEM_SECURITY_EMAIL_ADDRESS + - _APP_DB_HOST + - _APP_DB_PORT + - _APP_DB_SCHEMA + - _APP_DB_USER + - _APP_DB_PASS + - _APP_REDIS_HOST + - _APP_REDIS_PORT + - _APP_REDIS_USER + - _APP_REDIS_PASS + - _APP_LOGGING_CONFIG + appwrite-worker-deletes: + image: appwrite/appwrite:1.6.0 + entrypoint: worker-deletes + <<: *a1 + restart: unless-stopped + networks: + - dokploy-network + depends_on: + - redis + - mariadb + volumes: + - appwrite-uploads:/storage/uploads:rw + - appwrite-cache:/storage/cache:rw + - appwrite-functions:/storage/functions:rw + - appwrite-builds:/storage/builds:rw + - appwrite-certificates:/storage/certificates:rw + environment: + - _APP_ENV + - _APP_WORKER_PER_CORE + - _APP_OPENSSL_KEY_V1 + - _APP_REDIS_HOST + - _APP_REDIS_PORT + - _APP_REDIS_USER + - _APP_REDIS_PASS + - _APP_DB_HOST + - _APP_DB_PORT + - _APP_DB_SCHEMA + - _APP_DB_USER + - _APP_DB_PASS + - _APP_STORAGE_DEVICE + - _APP_STORAGE_S3_ACCESS_KEY + - _APP_STORAGE_S3_SECRET + - _APP_STORAGE_S3_REGION + - _APP_STORAGE_S3_BUCKET + - _APP_STORAGE_DO_SPACES_ACCESS_KEY + - _APP_STORAGE_DO_SPACES_SECRET + - _APP_STORAGE_DO_SPACES_REGION + - _APP_STORAGE_DO_SPACES_BUCKET + - _APP_STORAGE_BACKBLAZE_ACCESS_KEY + - _APP_STORAGE_BACKBLAZE_SECRET + - _APP_STORAGE_BACKBLAZE_REGION + - _APP_STORAGE_BACKBLAZE_BUCKET + - _APP_STORAGE_LINODE_ACCESS_KEY + - _APP_STORAGE_LINODE_SECRET + - _APP_STORAGE_LINODE_REGION + - _APP_STORAGE_LINODE_BUCKET + - _APP_STORAGE_WASABI_ACCESS_KEY + - _APP_STORAGE_WASABI_SECRET + - _APP_STORAGE_WASABI_REGION + - _APP_STORAGE_WASABI_BUCKET + - _APP_LOGGING_CONFIG + - _APP_EXECUTOR_SECRET + - _APP_EXECUTOR_HOST + - _APP_MAINTENANCE_RETENTION_ABUSE + - _APP_MAINTENANCE_RETENTION_AUDIT + - _APP_MAINTENANCE_RETENTION_EXECUTION + appwrite-worker-databases: + image: appwrite/appwrite:1.6.0 + entrypoint: worker-databases + <<: *a1 + restart: unless-stopped + networks: + - dokploy-network + depends_on: + - redis + - mariadb + environment: + - _APP_ENV + - _APP_WORKER_PER_CORE + - _APP_OPENSSL_KEY_V1 + - _APP_REDIS_HOST + - _APP_REDIS_PORT + - _APP_REDIS_USER + - _APP_REDIS_PASS + - _APP_DB_HOST + - _APP_DB_PORT + - _APP_DB_SCHEMA + - _APP_DB_USER + - _APP_DB_PASS + - _APP_LOGGING_CONFIG + appwrite-worker-builds: + image: appwrite/appwrite:1.6.0 + entrypoint: worker-builds + <<: *a1 + restart: unless-stopped + networks: + - dokploy-network + depends_on: + - redis + - mariadb + volumes: + - appwrite-functions:/storage/functions:rw + - appwrite-builds:/storage/builds:rw + environment: + - _APP_ENV + - _APP_WORKER_PER_CORE + - _APP_OPENSSL_KEY_V1 + - _APP_EXECUTOR_SECRET + - _APP_EXECUTOR_HOST + - _APP_REDIS_HOST + - _APP_REDIS_PORT + - _APP_REDIS_USER + - _APP_REDIS_PASS + - _APP_DB_HOST + - _APP_DB_PORT + - _APP_DB_SCHEMA + - _APP_DB_USER + - _APP_DB_PASS + - _APP_LOGGING_CONFIG + - _APP_VCS_GITHUB_APP_NAME + - _APP_VCS_GITHUB_PRIVATE_KEY + - _APP_VCS_GITHUB_APP_ID + - _APP_FUNCTIONS_TIMEOUT + - _APP_FUNCTIONS_BUILD_TIMEOUT + - _APP_FUNCTIONS_CPUS + - _APP_FUNCTIONS_MEMORY + - _APP_FUNCTIONS_SIZE_LIMIT + - _APP_OPTIONS_FORCE_HTTPS + - _APP_OPTIONS_FUNCTIONS_FORCE_HTTPS + - _APP_DOMAIN + - _APP_STORAGE_DEVICE + - _APP_STORAGE_S3_ACCESS_KEY + - _APP_STORAGE_S3_SECRET + - _APP_STORAGE_S3_REGION + - _APP_STORAGE_S3_BUCKET + - _APP_STORAGE_DO_SPACES_ACCESS_KEY + - _APP_STORAGE_DO_SPACES_SECRET + - _APP_STORAGE_DO_SPACES_REGION + - _APP_STORAGE_DO_SPACES_BUCKET + - _APP_STORAGE_BACKBLAZE_ACCESS_KEY + - _APP_STORAGE_BACKBLAZE_SECRET + - _APP_STORAGE_BACKBLAZE_REGION + - _APP_STORAGE_BACKBLAZE_BUCKET + - _APP_STORAGE_LINODE_ACCESS_KEY + - _APP_STORAGE_LINODE_SECRET + - _APP_STORAGE_LINODE_REGION + - _APP_STORAGE_LINODE_BUCKET + - _APP_STORAGE_WASABI_ACCESS_KEY + - _APP_STORAGE_WASABI_SECRET + - _APP_STORAGE_WASABI_REGION + - _APP_STORAGE_WASABI_BUCKET + appwrite-worker-certificates: + image: appwrite/appwrite:1.6.0 + entrypoint: worker-certificates + <<: *a1 + restart: unless-stopped + networks: + - dokploy-network + depends_on: + - redis + - mariadb + volumes: + - appwrite-config:/storage/config:rw + - appwrite-certificates:/storage/certificates:rw + environment: + - _APP_ENV + - _APP_WORKER_PER_CORE + - _APP_OPENSSL_KEY_V1 + - _APP_DOMAIN + - _APP_DOMAIN_TARGET + - _APP_DOMAIN_FUNCTIONS + - _APP_EMAIL_CERTIFICATES + - _APP_REDIS_HOST + - _APP_REDIS_PORT + - _APP_REDIS_USER + - _APP_REDIS_PASS + - _APP_DB_HOST + - _APP_DB_PORT + - _APP_DB_SCHEMA + - _APP_DB_USER + - _APP_DB_PASS + - _APP_LOGGING_CONFIG + appwrite-worker-functions: + image: appwrite/appwrite:1.6.0 + entrypoint: worker-functions + <<: *a1 + restart: unless-stopped + networks: + - dokploy-network + depends_on: + - redis + - mariadb + - openruntimes-executor + environment: + - _APP_ENV + - _APP_WORKER_PER_CORE + - _APP_OPENSSL_KEY_V1 + - _APP_DOMAIN + - _APP_OPTIONS_FORCE_HTTPS + - _APP_REDIS_HOST + - _APP_REDIS_PORT + - _APP_REDIS_USER + - _APP_REDIS_PASS + - _APP_DB_HOST + - _APP_DB_PORT + - _APP_DB_SCHEMA + - _APP_DB_USER + - _APP_DB_PASS + - _APP_FUNCTIONS_TIMEOUT + - _APP_FUNCTIONS_BUILD_TIMEOUT + - _APP_FUNCTIONS_CPUS + - _APP_FUNCTIONS_MEMORY + - _APP_EXECUTOR_SECRET + - _APP_EXECUTOR_HOST + - _APP_USAGE_STATS + - _APP_DOCKER_HUB_USERNAME + - _APP_DOCKER_HUB_PASSWORD + - _APP_LOGGING_CONFIG + appwrite-worker-mails: + image: appwrite/appwrite:1.6.0 + entrypoint: worker-mails + <<: *a1 + restart: unless-stopped + networks: + - dokploy-network + depends_on: + - redis + environment: + - _APP_ENV + - _APP_WORKER_PER_CORE + - _APP_OPENSSL_KEY_V1 + - _APP_SYSTEM_EMAIL_NAME + - _APP_SYSTEM_EMAIL_ADDRESS + - _APP_DB_HOST + - _APP_DB_PORT + - _APP_DB_SCHEMA + - _APP_DB_USER + - _APP_DB_PASS + - _APP_REDIS_HOST + - _APP_REDIS_PORT + - _APP_REDIS_USER + - _APP_REDIS_PASS + - _APP_SMTP_HOST + - _APP_SMTP_PORT + - _APP_SMTP_SECURE + - _APP_SMTP_USERNAME + - _APP_SMTP_PASSWORD + - _APP_LOGGING_CONFIG + appwrite-worker-messaging: + image: appwrite/appwrite:1.6.0 + entrypoint: worker-messaging + <<: *a1 + restart: unless-stopped + networks: + - dokploy-network + volumes: + - appwrite-uploads:/storage/uploads:rw + depends_on: + - redis + environment: + - _APP_ENV + - _APP_WORKER_PER_CORE + - _APP_OPENSSL_KEY_V1 + - _APP_REDIS_HOST + - _APP_REDIS_PORT + - _APP_REDIS_USER + - _APP_REDIS_PASS + - _APP_DB_HOST + - _APP_DB_PORT + - _APP_DB_SCHEMA + - _APP_DB_USER + - _APP_DB_PASS + - _APP_LOGGING_CONFIG + - _APP_SMS_FROM + - _APP_SMS_PROVIDER + - _APP_STORAGE_DEVICE + - _APP_STORAGE_S3_ACCESS_KEY + - _APP_STORAGE_S3_SECRET + - _APP_STORAGE_S3_REGION + - _APP_STORAGE_S3_BUCKET + - _APP_STORAGE_DO_SPACES_ACCESS_KEY + - _APP_STORAGE_DO_SPACES_SECRET + - _APP_STORAGE_DO_SPACES_REGION + - _APP_STORAGE_DO_SPACES_BUCKET + - _APP_STORAGE_BACKBLAZE_ACCESS_KEY + - _APP_STORAGE_BACKBLAZE_SECRET + - _APP_STORAGE_BACKBLAZE_REGION + - _APP_STORAGE_BACKBLAZE_BUCKET + - _APP_STORAGE_LINODE_ACCESS_KEY + - _APP_STORAGE_LINODE_SECRET + - _APP_STORAGE_LINODE_REGION + - _APP_STORAGE_LINODE_BUCKET + - _APP_STORAGE_WASABI_ACCESS_KEY + - _APP_STORAGE_WASABI_SECRET + - _APP_STORAGE_WASABI_REGION + - _APP_STORAGE_WASABI_BUCKET + appwrite-worker-migrations: + image: appwrite/appwrite:1.6.0 + entrypoint: worker-migrations + <<: *a1 + restart: unless-stopped + networks: + - dokploy-network + depends_on: + - mariadb + environment: + - _APP_ENV + - _APP_WORKER_PER_CORE + - _APP_OPENSSL_KEY_V1 + - _APP_DOMAIN + - _APP_DOMAIN_TARGET + - _APP_EMAIL_SECURITY + - _APP_REDIS_HOST + - _APP_REDIS_PORT + - _APP_REDIS_USER + - _APP_REDIS_PASS + - _APP_DB_HOST + - _APP_DB_PORT + - _APP_DB_SCHEMA + - _APP_DB_USER + - _APP_DB_PASS + - _APP_LOGGING_CONFIG + - _APP_MIGRATIONS_FIREBASE_CLIENT_ID + - _APP_MIGRATIONS_FIREBASE_CLIENT_SECRET + appwrite-task-maintenance: + image: appwrite/appwrite:1.6.0 + entrypoint: maintenance + <<: *a1 + restart: unless-stopped + networks: + - dokploy-network + depends_on: + - redis + environment: + - _APP_ENV + - _APP_WORKER_PER_CORE + - _APP_DOMAIN + - _APP_DOMAIN_TARGET + - _APP_DOMAIN_FUNCTIONS + - _APP_OPENSSL_KEY_V1 + - _APP_REDIS_HOST + - _APP_REDIS_PORT + - _APP_REDIS_USER + - _APP_REDIS_PASS + - _APP_DB_HOST + - _APP_DB_PORT + - _APP_DB_SCHEMA + - _APP_DB_USER + - _APP_DB_PASS + - _APP_MAINTENANCE_INTERVAL + - _APP_MAINTENANCE_RETENTION_EXECUTION + - _APP_MAINTENANCE_RETENTION_CACHE + - _APP_MAINTENANCE_RETENTION_ABUSE + - _APP_MAINTENANCE_RETENTION_AUDIT + - _APP_MAINTENANCE_RETENTION_USAGE_HOURLY + - _APP_MAINTENANCE_RETENTION_SCHEDULES + appwrite-worker-usage: + image: appwrite/appwrite:1.6.0 + entrypoint: worker-usage + <<: *a1 + restart: unless-stopped + networks: + - dokploy-network + depends_on: + - redis + - mariadb + environment: + - _APP_ENV + - _APP_WORKER_PER_CORE + - _APP_OPENSSL_KEY_V1 + - _APP_DB_HOST + - _APP_DB_PORT + - _APP_DB_SCHEMA + - _APP_DB_USER + - _APP_DB_PASS + - _APP_REDIS_HOST + - _APP_REDIS_PORT + - _APP_REDIS_USER + - _APP_REDIS_PASS + - _APP_USAGE_STATS + - _APP_LOGGING_CONFIG + - _APP_USAGE_AGGREGATION_INTERVAL + appwrite-worker-usage-dump: + image: appwrite/appwrite:1.6.0 + entrypoint: worker-usage-dump + <<: *a1 + networks: + - dokploy-network + depends_on: + - redis + - mariadb + environment: + - _APP_ENV + - _APP_WORKER_PER_CORE + - _APP_OPENSSL_KEY_V1 + - _APP_DB_HOST + - _APP_DB_PORT + - _APP_DB_SCHEMA + - _APP_DB_USER + - _APP_DB_PASS + - _APP_REDIS_HOST + - _APP_REDIS_PORT + - _APP_REDIS_USER + - _APP_REDIS_PASS + - _APP_USAGE_STATS + - _APP_LOGGING_CONFIG + - _APP_USAGE_AGGREGATION_INTERVAL + appwrite-task-scheduler-functions: + image: appwrite/appwrite:1.6.0 + entrypoint: schedule-functions + <<: *a1 + restart: unless-stopped + networks: + - dokploy-network + depends_on: + - mariadb + - redis + environment: + - _APP_ENV + - _APP_WORKER_PER_CORE + - _APP_OPENSSL_KEY_V1 + - _APP_REDIS_HOST + - _APP_REDIS_PORT + - _APP_REDIS_USER + - _APP_REDIS_PASS + - _APP_DB_HOST + - _APP_DB_PORT + - _APP_DB_SCHEMA + - _APP_DB_USER + - _APP_DB_PASS + appwrite-task-scheduler-executions: + image: appwrite/appwrite:1.6.0 + entrypoint: schedule-executions + <<: *a1 + restart: unless-stopped + networks: + - dokploy-network + depends_on: + - mariadb + - redis + environment: + - _APP_ENV + - _APP_WORKER_PER_CORE + - _APP_OPENSSL_KEY_V1 + - _APP_REDIS_HOST + - _APP_REDIS_PORT + - _APP_REDIS_USER + - _APP_REDIS_PASS + - _APP_DB_HOST + - _APP_DB_PORT + - _APP_DB_SCHEMA + - _APP_DB_USER + - _APP_DB_PASS + appwrite-task-scheduler-messages: + image: appwrite/appwrite:1.6.0 + entrypoint: schedule-messages + <<: *a1 + restart: unless-stopped + networks: + - dokploy-network + depends_on: + - mariadb + - redis + environment: + - _APP_ENV + - _APP_WORKER_PER_CORE + - _APP_OPENSSL_KEY_V1 + - _APP_REDIS_HOST + - _APP_REDIS_PORT + - _APP_REDIS_USER + - _APP_REDIS_PASS + - _APP_DB_HOST + - _APP_DB_PORT + - _APP_DB_SCHEMA + - _APP_DB_USER + - _APP_DB_PASS + appwrite-assistant: + image: appwrite/assistant:0.4.0 + <<: *a1 + restart: unless-stopped + networks: + - dokploy-network + environment: + - _APP_ASSISTANT_OPENAI_API_KEY + openruntimes-executor: + hostname: exc1 + <<: *a1 + restart: unless-stopped + stop_signal: SIGINT + image: openruntimes/executor:0.6.11 + networks: + - dokploy-network + - runtimes + volumes: + - /var/run/docker.sock:/var/run/docker.sock + - appwrite-builds:/storage/builds:rw + - appwrite-functions:/storage/functions:rw + - /tmp:/tmp:rw + environment: + - OPR_EXECUTOR_INACTIVE_TRESHOLD=$_APP_FUNCTIONS_INACTIVE_THRESHOLD + - OPR_EXECUTOR_MAINTENANCE_INTERVAL=$_APP_FUNCTIONS_MAINTENANCE_INTERVAL + - OPR_EXECUTOR_NETWORK=$_APP_FUNCTIONS_RUNTIMES_NETWORK + - OPR_EXECUTOR_DOCKER_HUB_USERNAME=$_APP_DOCKER_HUB_USERNAME + - OPR_EXECUTOR_DOCKER_HUB_PASSWORD=$_APP_DOCKER_HUB_PASSWORD + - OPR_EXECUTOR_ENV=$_APP_ENV + - OPR_EXECUTOR_RUNTIMES=$_APP_FUNCTIONS_RUNTIMES + - OPR_EXECUTOR_SECRET=$_APP_EXECUTOR_SECRET + - OPR_EXECUTOR_LOGGING_CONFIG=$_APP_LOGGING_CONFIG + - OPR_EXECUTOR_STORAGE_DEVICE=$_APP_STORAGE_DEVICE + - OPR_EXECUTOR_STORAGE_S3_ACCESS_KEY=$_APP_STORAGE_S3_ACCESS_KEY + - OPR_EXECUTOR_STORAGE_S3_SECRET=$_APP_STORAGE_S3_SECRET + - OPR_EXECUTOR_STORAGE_S3_REGION=$_APP_STORAGE_S3_REGION + - OPR_EXECUTOR_STORAGE_S3_BUCKET=$_APP_STORAGE_S3_BUCKET + - OPR_EXECUTOR_STORAGE_DO_SPACES_ACCESS_KEY=$_APP_STORAGE_DO_SPACES_ACCESS_KEY + - OPR_EXECUTOR_STORAGE_DO_SPACES_SECRET=$_APP_STORAGE_DO_SPACES_SECRET + - OPR_EXECUTOR_STORAGE_DO_SPACES_REGION=$_APP_STORAGE_DO_SPACES_REGION + - OPR_EXECUTOR_STORAGE_DO_SPACES_BUCKET=$_APP_STORAGE_DO_SPACES_BUCKET + - OPR_EXECUTOR_STORAGE_BACKBLAZE_ACCESS_KEY=$_APP_STORAGE_BACKBLAZE_ACCESS_KEY + - OPR_EXECUTOR_STORAGE_BACKBLAZE_SECRET=$_APP_STORAGE_BACKBLAZE_SECRET + - OPR_EXECUTOR_STORAGE_BACKBLAZE_REGION=$_APP_STORAGE_BACKBLAZE_REGION + - OPR_EXECUTOR_STORAGE_BACKBLAZE_BUCKET=$_APP_STORAGE_BACKBLAZE_BUCKET + - OPR_EXECUTOR_STORAGE_LINODE_ACCESS_KEY=$_APP_STORAGE_LINODE_ACCESS_KEY + - OPR_EXECUTOR_STORAGE_LINODE_SECRET=$_APP_STORAGE_LINODE_SECRET + - OPR_EXECUTOR_STORAGE_LINODE_REGION=$_APP_STORAGE_LINODE_REGION + - OPR_EXECUTOR_STORAGE_LINODE_BUCKET=$_APP_STORAGE_LINODE_BUCKET + - OPR_EXECUTOR_STORAGE_WASABI_ACCESS_KEY=$_APP_STORAGE_WASABI_ACCESS_KEY + - OPR_EXECUTOR_STORAGE_WASABI_SECRET=$_APP_STORAGE_WASABI_SECRET + - OPR_EXECUTOR_STORAGE_WASABI_REGION=$_APP_STORAGE_WASABI_REGION + - OPR_EXECUTOR_STORAGE_WASABI_BUCKET=$_APP_STORAGE_WASABI_BUCKET + mariadb: + image: mariadb:10.11 # fix issues when upgrading using: mysql_upgrade -u root -p + <<: *a1 + restart: unless-stopped + networks: + - dokploy-network + volumes: + - appwrite-mariadb:/var/lib/mysql:rw + environment: + - MYSQL_ROOT_PASSWORD=${_APP_DB_ROOT_PASS} + - MYSQL_DATABASE=${_APP_DB_SCHEMA} + - MYSQL_USER=${_APP_DB_USER} + - MYSQL_PASSWORD=${_APP_DB_PASS} + - MARIADB_AUTO_UPGRADE=1 + command: mysqld --innodb-flush-method=fsync + redis: + image: redis:7.2.4-alpine + <<: *a1 + restart: unless-stopped + command: > + redis-server --maxmemory 512mb + --maxmemory-policy allkeys-lru --maxmemory-samples 5 + networks: + - dokploy-network + volumes: + - appwrite-redis:/data:rw + # clamav: + # image: appwrite/clamav:1.2.0 + # container_name: appwrite-clamav + # restart: unless-stopped + # networks: + # - appwrite + # volumes: + # - appwrite-uploads:/storage/uploads + +networks: + runtimes: + name: runtimes + dokploy-network: + external: true + +volumes: + appwrite-mariadb: null + appwrite-redis: null + appwrite-cache: null + appwrite-uploads: null + appwrite-certificates: null + appwrite-functions: null + appwrite-builds: null + appwrite-config: null diff --git a/apps/dokploy/templates/appwrite/index.ts b/apps/dokploy/templates/appwrite/index.ts new file mode 100644 index 000000000..e784653d3 --- /dev/null +++ b/apps/dokploy/templates/appwrite/index.ts @@ -0,0 +1,128 @@ +import { Schema, Template } from "../utils"; + +export function generate(schema: Schema): Template { + const envs = [ + "_APP_ENV=production", + "_APP_LOCALE=en", + "_APP_OPTIONS_ABUSE=enabled", + "_APP_OPTIONS_FORCE_HTTPS=disabled", + "_APP_OPTIONS_FUNCTIONS_FORCE_HTTPS=disabled", + "_APP_OPTIONS_ROUTER_PROTECTION=disabled", + "_APP_OPENSSL_KEY_V1=ADD_PASS_HERE", + "_APP_DOMAIN=YOUR_DOMAIN_HERE", + "_APP_DOMAIN_FUNCTIONS=YOUR_FUNCTION_DOMAIN_HERE", + "_APP_DOMAIN_TARGET=YOUR_DOMAIN_HERE", + "_APP_CONSOLE_WHITELIST_ROOT=enabled", + "_APP_CONSOLE_WHITELIST_EMAILS=", + "_APP_CONSOLE_WHITELIST_IPS=", + "_APP_CONSOLE_HOSTNAMES=", + "_APP_SYSTEM_EMAIL_NAME=Appwrite", + "_APP_SYSTEM_EMAIL_ADDRESS=", + "_APP_SYSTEM_TEAM_EMAIL=team@appwrite.io", + "_APP_SYSTEM_RESPONSE_FORMAT=", + "_APP_SYSTEM_SECURITY_EMAIL_ADDRESS=certs@appwrite.io", + "_APP_EMAIL_SECURITY=", + "_APP_EMAIL_CERTIFICATES=", + "_APP_USAGE_STATS=enabled", + "_APP_LOGGING_PROVIDER=", + "_APP_LOGGING_CONFIG=", + "_APP_USAGE_AGGREGATION_INTERVAL=30", + "_APP_USAGE_TIMESERIES_INTERVAL=30", + "_APP_USAGE_DATABASE_INTERVAL=900", + "_APP_WORKER_PER_CORE=6", + "_APP_CONSOLE_SESSION_ALERTS=disabled", + "_APP_REDIS_HOST=redis", + "_APP_REDIS_PORT=6379", + "_APP_REDIS_USER=", + "_APP_REDIS_PASS=", + "_APP_DB_HOST=mariadb", + "_APP_DB_PORT=3306", + "_APP_DB_SCHEMA=appwrite", + "_APP_DB_USER=user", + "_APP_DB_PASS=password", + "_APP_DB_ROOT_PASS=rootsecretpassword", + "_APP_INFLUXDB_HOST=influxdb", + "_APP_INFLUXDB_PORT=8086", + "_APP_STATSD_HOST=telegraf", + "_APP_STATSD_PORT=8125", + "_APP_SMTP_HOST=", + "_APP_SMTP_PORT=", + "_APP_SMTP_SECURE=tls", + "_APP_SMTP_USERNAME=", + "_APP_SMTP_PASSWORD=", + "_APP_SMS_PROVIDER=", + "_APP_SMS_FROM=", + "_APP_STORAGE_LIMIT=30000000", + "_APP_STORAGE_PREVIEW_LIMIT=20000000", + "_APP_STORAGE_ANTIVIRUS=disabled", + "_APP_STORAGE_ANTIVIRUS_HOST=clamav", + "_APP_STORAGE_ANTIVIRUS_PORT=3310", + "_APP_STORAGE_DEVICE=local", + "_APP_STORAGE_S3_ACCESS_KEY=", + "_APP_STORAGE_S3_SECRET=", + "_APP_STORAGE_S3_REGION=us-east-1", + "_APP_STORAGE_S3_BUCKET=", + "_APP_STORAGE_DO_SPACES_ACCESS_KEY=", + "_APP_STORAGE_DO_SPACES_SECRET=", + "_APP_STORAGE_DO_SPACES_REGION=us-east-1", + "_APP_STORAGE_DO_SPACES_BUCKET=", + "_APP_STORAGE_BACKBLAZE_ACCESS_KEY=", + "_APP_STORAGE_BACKBLAZE_SECRET=", + "_APP_STORAGE_BACKBLAZE_REGION=us-west-004", + "_APP_STORAGE_BACKBLAZE_BUCKET=", + "_APP_STORAGE_LINODE_ACCESS_KEY=", + "_APP_STORAGE_LINODE_SECRET=", + "_APP_STORAGE_LINODE_REGION=eu-central-1", + "_APP_STORAGE_LINODE_BUCKET=", + "_APP_STORAGE_WASABI_ACCESS_KEY=", + "_APP_STORAGE_WASABI_SECRET=", + "_APP_STORAGE_WASABI_REGION=eu-central-1", + "_APP_STORAGE_WASABI_BUCKET=", + "_APP_FUNCTIONS_SIZE_LIMIT=30000000", + "_APP_FUNCTIONS_BUILD_SIZE_LIMIT=2000000000", + "_APP_FUNCTIONS_TIMEOUT=900", + "_APP_FUNCTIONS_BUILD_TIMEOUT=900", + "_APP_FUNCTIONS_CONTAINERS=10", + "_APP_FUNCTIONS_CPUS=0", + "_APP_FUNCTIONS_MEMORY=0", + "_APP_FUNCTIONS_MEMORY_SWAP=0", + "_APP_FUNCTIONS_RUNTIMES=node-20.0,php-8.2,python-3.11,ruby-3.0,deno-1.40,dotnet-7.0,cpp-20,bun-1.0", + "_APP_EXECUTOR_SECRET=your-secret-key", + "_APP_EXECUTOR_HOST=http://exc1/v1", + "_APP_EXECUTOR_RUNTIME_NETWORK=appwrite_runtimes", + "_APP_FUNCTIONS_ENVS=node-16.0,php-7.4,python-3.9,ruby-3.0", + "_APP_FUNCTIONS_INACTIVE_THRESHOLD=60", + "DOCKERHUB_PULL_USERNAME=", + "DOCKERHUB_PULL_PASSWORD=", + "DOCKERHUB_PULL_EMAIL=", + "OPEN_RUNTIMES_NETWORK=appwrite_runtimes", + "_APP_FUNCTIONS_RUNTIMES_NETWORK=runtimes", + "_APP_DOCKER_HUB_USERNAME=", + "_APP_DOCKER_HUB_PASSWORD=", + "_APP_FUNCTIONS_MAINTENANCE_INTERVAL=3600", + "_APP_VCS_GITHUB_APP_NAME=", + "_APP_VCS_GITHUB_PRIVATE_KEY=", + "_APP_VCS_GITHUB_APP_ID=", + "_APP_VCS_GITHUB_CLIENT_ID=", + "_APP_VCS_GITHUB_CLIENT_SECRET=", + "_APP_VCS_GITHUB_WEBHOOK_SECRET=", + "_APP_MAINTENANCE_INTERVAL=86400", + "_APP_MAINTENANCE_DELAY=0", + "_APP_MAINTENANCE_RETENTION_CACHE=2592000", + "_APP_MAINTENANCE_RETENTION_EXECUTION=1209600", + "_APP_MAINTENANCE_RETENTION_AUDIT=1209600", + "_APP_MAINTENANCE_RETENTION_ABUSE=86400", + "_APP_MAINTENANCE_RETENTION_USAGE_HOURLY=8640000", + "_APP_MAINTENANCE_RETENTION_SCHEDULES=86400", + "_APP_GRAPHQL_MAX_BATCH_SIZE=10", + "_APP_GRAPHQL_MAX_COMPLEXITY=250", + "_APP_GRAPHQL_MAX_DEPTH=3", + "_APP_MIGRATIONS_FIREBASE_CLIENT_ID=", + "_APP_MIGRATIONS_FIREBASE_CLIENT_SECRET=", + "_APP_ASSISTANT_OPENAI_API_KEY=", + ]; + + return { + envs + }; +} diff --git a/apps/dokploy/templates/templates.ts b/apps/dokploy/templates/templates.ts index 28af7c56e..10b1d9573 100644 --- a/apps/dokploy/templates/templates.ts +++ b/apps/dokploy/templates/templates.ts @@ -702,4 +702,19 @@ export const templates: TemplateData[] = [ tags: ["IA", "chat"], load: () => import("./lobe-chat/index").then((m) => m.generate), }, + { + id: "appwrite", + name: "Appwrite", + version: "1.6.0", + description: + "Appwrite is an open-source platform for building applications at any scale, using your preferred programming languages and tools.. ", + links: { + github: "https://github.com/appwrite/appwrite", + website: "https://https://appwrite.io/", + docs: "https://appwrite.io/docs", + }, + logo: "appwrite.svg", + load: () => import("./appwrite/index").then((m) => m.generate), + tags: ["database", "firebase", "nosql","BaaS"], + }, ]; From 605c3d0d761131b043b7c6dce1489c10f5e37fa2 Mon Sep 17 00:00:00 2001 From: Cristopher Caamana Date: Mon, 11 Nov 2024 13:58:50 +0000 Subject: [PATCH 2/2] added logo --- apps/dokploy/public/templates/appwrite.svg | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 apps/dokploy/public/templates/appwrite.svg diff --git a/apps/dokploy/public/templates/appwrite.svg b/apps/dokploy/public/templates/appwrite.svg new file mode 100644 index 000000000..86dcbff81 --- /dev/null +++ b/apps/dokploy/public/templates/appwrite.svg @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file