Ana içeriğe geç
Version: 1.6.0

Infrastructure Overview

In this chapter, you are going to take a deep dive into the Appconda infrastructure. It's more theoretical, so be warned.

The Infrastructure

Appconda use a docker-compose.yml file for setup and running is infrastructure.

docker-compose.yml is a yaml file that define the services, volumes and networks needed to run.

Containers & Images In Docker, Containers are a sort of virtual machines running instance of a specific Docker Image. Docker Image is a file that contains all the files and software needed to run a certain service.

Here's a quick overview of Appconda docker-compose.yml file.

Service NameImageDescription
traefiktraefik:2.7Load balancer and traffic router
appcondaappconda/appconda:1.3.8Appconda Console & API main entrypoint
mariadbmariadb:10.7App & System Database
redisredis:7.0.4-alpineKey Value on-RAM Database, use to store temporary workers data for queue-based process and cache
influxdbappconda/influxdb:1.5.0Timebase Database. use to track Appconda usages.
telegrafappconda/telegraf:1.4.0Server Metric usage collector
appconda-realtimeappconda/appconda:1.3.8Appconda Realtime entrypoint
appconda-executorappconda/appconda:1.3.8On-demand Function creator and manager
appconda-maintenanceappconda/appconda:1.3.8Maintainer. Do all non-specific jobs. for example adding certificate requirement to the queue
appconda-usageappconda/appconda:1.3.8Usage tracker. Transfers information from influxdb into MariaDB
appconda-scheduleappconda/appconda:1.3.8The crontab (Schedule) manager.
appconda-worker-auditsappconda/appconda:1.3.8Queue Worker - Log information for auditing purposes.
appconda-worker-webhooksappconda/appconda:1.3.8Queue Worker - CURL any needed webhooks
appconda-worker-deletesappconda/appconda:1.3.8Queue Worker - Deleting projects, users, collection, documents and anything else.
appconda-worker-databasesappconda/appconda:1.3.8Queue Worker - Runs any management needed action on the database, e.g. Adding index.
appconda-worker-buildsappconda/appconda:1.3.8Queue Worker - Building deployment of newly deployed functions.
appconda-worker-certificatesappconda/appconda:1.3.8Queue Worker - Created required in-queue certificate
appconda-worker-functionsappconda/appconda:1.3.8Queue Worker - Execute any in-queue function.
appconda-worker-mailsappconda/appconda:1.3.8Queue Worker - Sends any Appconda internal emails.
appconda-worker-messagingappconda/appconda:1.3.8Queue Worker - Sends SMS for auth.

Good To Know

As you can see most of the services are sharing the same Docker image Appconda/Appconda:1.3.8

This approach is quite smart and although that each service is accessing and using different part of the image, it's still one image.

So when a new version is being released all the services will use the new one, and you get an advantage of monorepo approach in a way that you force yourself to make sure that all the services can run with the new image.

What eventually makes upgrading much easy and much more fail-proof.

Networks

In Docker, Networks are a way to connect between containers. Think of them as a virtual switch/router.

Networks are a way to define which containers can communicate with each other, as containers contact each other through the network. That way you can isolate containers from each other.

List of Networks

Here's a quick overview of Appconda networks.

NetworkUsage
gatewayDefault network Not in use
AppcondaAppconda main network shared across all containers except the dynamically created open-runtime containers
runtimeIsolated network between the Appconda-executor and any dynamically created open-runtime container(s)

Volumes

In Docker, Volumes are a way to store data outside the container. Any data that is stored in a volume will persist even if the container is failed, stopped or deleted.

List of Volumes

Here's a quick overview of Appconda volumes.

volumesUsageUsed By # Containers
Appconda-mariadbMariaDBmariadb
Appconda-redisRedisredis
Appconda-cacheCacheAppconda
Appconda-worker-deletes
Appconda-uploadsStorageAppconda
Appconda-worker-deletes
Appconda-certificatesCertificationtraefik
Appconda
Appconda-worker-deletes
Appconda-worker-certificates
Appconda-functionsPrebuilt functionsAppconda
Appconda-worker-deletes
Appconda-executor
Appconda-buildsBuilt functionsAppconda-worker-deletes
Appconda-executor
Appconda-influxdbInfluxDBinfluxdb
Appconda-configYaml files for each custom-domaintraefik
Appconda
Appconda-worker-certificates
Appconda-executorN/A

Environment variables

When running any docker container, you may want to pass some environment variables to it. Passing environment variables to a container is a way to configure the container without having the need to change the container itself.

Available Environment variables

I've included only those variables needed to have attention. The full list can be found here.

VariableDefault value
_APP_LOCALE
Set Appconda locale for login emails, teams join and more.
Here you can find list of all the languages are supported by Appcondaen
_APP_OPTIONS_ABUSE
Activate Appconda Rate Limit service.
Can be either enabled or disabled.enabled
_APP_OPTIONS_FORCE_HTTPS
If enabled the console & API will accept HTTPS request only
Can be either enabled or disabled.disabled
_APP_OPENSSL_KEY_V1
Random key created by you.
Will be used to encrypt the JWT token and your files.
Change it to some random long text and make backup of ityour-secret-key
_APP_DOMAIN
The domain you'll point to your Appconda server IPlocalhost
_APP_DOMAIN_TARGET
The domain that any added custom-domain will point using CNAME.
Usually it will be the same value as _APP_DOMAINlocalhost
_APP_CONSOLE_WHITELIST_ROOT
When enabled only one user can be created in the console signup form.
Then either you disable this option, or you can send a direct invention to a user.enabled
_APP_CONSOLE_WHITELIST_EMAILS
When APP_CONSOLE_WHITELIST_ROOT is 'disabled' then you can block the signup to specific emails
Separate each email using the comma character.
_APP_CONSOLE_WHITELIST_IPS
When APP_CONSOLE_WHITELIST_ROOT is 'disabled' then you can block the signup to specific IPs
Separate each IP using the comma character.
_APP_SYSTEM_EMAIL_NAME
The sender name in any Appconda generated emails, e.g. password recovery email.Appconda
_APP_SYSTEM_EMAIL_ADDRESS
The sender email in any Appconda generated emails, e.g. password recovery email.team@Appconda.io
_APP_SYSTEM_SECURITY_EMAIL_ADDRESS
Email address for Let's Encrypt alerts.
This email address is also sent in any curl (request that go out from your Appconda) request, eg. Webhooks and in the Avatar service.certs@Appconda.io
_APP_USAGE_STATS
Disable App stat collection.
Just to clearfix the usage collection is between you and Appconda, and not related to any usages data being collected by Appconda.
If you do disabled it you can remove the influxdb and telegraph containers as they won't be usedenabled
_APP_LOGGING_PROVIDER
Any custom logger.
You can use any of the following: sentry, raygun, appsignal, logowl
_APP_LOGGING_CONFIG
Custom logger config.
For sentry enter: SENTRY_KEY:SENTRY_ID.
For all the rest: enter single string for your API key or Service ticked in case of logowl
_APP_SMTP_HOST
SMTP host.
Recommended service are: SendInBlue and SendGrid.
_APP_SMTP_PORT
SMTP port.
_APP_SMTP_SECURE
SMTP secure type.
Usually can be: tls, starttls or none.
_APP_SMTP_USERNAME
SMTP Username
_APP_SMTP_PASSWORD
SMTP Password
_APP_FUNCTIONS_SIZE_LIMIT
Maximum size of deployed function.
Value is in bytes.30000000
_APP_FUNCTIONS_TIMEOUT
Function time out.
Meaning what is the maximum time to wait for function to complete.
Value is in seconds.900
_APP_FUNCTIONS_BUILD_TIMEOUT
Function build timeout.
Meaning what is the maximum time to wait before declare the build as failed.
Value is in seconds.900
_APP_FUNCTIONS_CONTAINERS
Maximum number of allowed dynamically created functions container.10
_APP_FUNCTIONS_CPUS
Maximum CPU core for each function.
0 means unlimited.0
_APP_FUNCTIONS_MEMORY
Maximum Memory for each function.
0 means unlimited.0
_APP_FUNCTIONS_MEMORY_SWAP
Maximum Swap Memory for each function.
0 means unlimited0
_APP_FUNCTIONS_RUNTIMES
Available runtimes to write your function in.
You can find the full list here as Appconda use another Appconda-tool called Open Runtimenode-16.0, php-8.0, python-3.9, ruby-3.0
_APP_EXECUTOR_SECRET
Secret key use by the executor (the function orchestrator)
Generate random one.your-secret-key
_APP_EXECUTOR_HOST
Full executor host. as you are using Docker network the endpoint will be the container namehttp://Appconda-executor/v1
_APP_FUNCTIONS_INACTIVE_THRESHOLD
Function idle timeout.
Meaning how much time of function idle time before the container will be destroyed.
Value in seconds.60