Image and architecture
- Images must be Linux images for the amd64 (x86-64) architecture. From a multi-architecture image the linux/amd64 variant is used. An image built only for arm64 does not start.
- The image runs with its own ENTRYPOINT, CMD, WORKDIR, and USER.
- A start command, when set, replaces ENTRYPOINT and CMD and is run as /bin/sh -c "<command>". The image must then contain /bin/sh.
- At every deployment the tag is resolved to a digest, and the release runs exactly that digest. Pushing a new image to the same tag has no effect until the next deployment.
- Containers run in an isolated sandbox. Privileged mode, host devices, host networking, and raw sockets (for example ping) are not available.
User and filesystem
- The process runs as the user set by USER in the image. If the image sets none, it runs as root inside the sandbox. Root and non-root images are both supported, and the user cannot be overridden in the service settings.
- A root process can change file ownership, switch to another user, and listen on ports below 1024. Setuid programs do not grant extra privileges, so sudo and su do not work for a non-root user.
- When the image runs as a non-root user, listen on a port above 1024.
- The container filesystem is writable but temporary: everything written outside a volume is lost whenever the instance restarts or is replaced.
- Files written outside volumes, together with the log output of the container, may use up to 512 MiB per instance. An instance that exceeds this is stopped and replaced.
- Log output is rotated automatically and occupies at most about 30 MiB, so logs alone cannot use up this limit.
Volumes
A volume is a persistent directory mounted at the path you choose. Its contents survive restarts and new releases.
- Every instance has its own disk. With more than one instance, or when two services mount the same volume, each instance sees different data. A single-file database such as SQLite therefore requires replicas 1.
- A disk is attached to one instance at a time. During a release the old instance is stopped before the new one starts, so two versions never write to the same volume.
- The mount is an ext4 filesystem of the requested size, from 1 to 100 GiB per disk. A full disk returns "no space left on device". A new disk contains a lost+found directory; software that needs an empty directory should use a subdirectory.
- The mounted directory belongs to group 1000 and is group-writable, and every process in the container is a member of group 1000 whatever its user. A non-root image can therefore write to a volume without changing ownership.
- An application can hold up to 10 disks and 100 GiB in total, counting every instance of every service.
- A volume can be made larger at any time and never smaller. The new size applies at the next deployment.
- The API does not report how full a disk is. Check free space from inside the container.
- Removing a mount, scaling down, stopping, or deleting a service keeps the disks, and they continue to be billed. Data is deleted only when you delete the volume or the application.
Volumes are stored on a single server and are not replicated or backed up. If that server is unavailable the service stays down until it returns, and data can be lost. Keep important files and database backups in ACDN Storage.
Environment and secrets
- A service has up to 64 variables. Names start with a letter or underscore and contain letters, digits, and underscores; values are up to 8192 characters.
- Variables and secrets both reach the container as ordinary environment variables. A secret differs in handling: it is stored encrypted, never returned by the API, and replaced with [REDACTED] in logs read through ACDN.
- Changes apply at the next deployment. Each release keeps the values it was deployed with, so a rollback also restores the environment and secrets of that release.
- The platform sets HOSTNAME and may set, for the services of the application including the service itself, variables such as WEB_SERVICE_HOST, WEB_SERVICE_PORT, and WEB_PORT, where WEB is the service name in upper case. WEB_PORT has the form tcp://address:port. Do not rely on these variables, and do not read a NAME_PORT variable as a number unless you set it yourself: your own variables with the same names take precedence.
- There is no PORT variable. Your process must listen on the port you set as http_port.
Start and shutdown
- An instance is shut down at every release, restart, stop, and scale-down, and when the platform has to move it.
- Shutdown sends SIGTERM, or the STOPSIGNAL declared in the image, to the main process and waits up to 30 seconds. A process that is still running then receives SIGKILL.
- The main process is process 1 of the container. With a start command, process 1 is the shell: begin the command with exec so that your program receives the signal, for example exec node server.js.
- On SIGTERM stop accepting connections, close open ones including WebSockets, flush data to the volume, and exit. The instance is taken out of routing when shutdown begins.
- If the main process exits for any reason, the instance is restarted automatically, with a growing delay between attempts.
Resource limits
- CPU: up to 4 cores per instance. Use above the limit is slowed down, not stopped.
- Memory: up to 8 GiB per instance. An instance that exceeds it is killed and restarted, and the deployment timeline reports that the memory limit was exceeded.
- These limits are the same for every service and cannot be changed. You pay for the CPU time and memory actually used, not for the limits.
- Instances: one application runs at most 3 at once, counting the temporary extra instance of a release of a service without volumes. The API rejects a configuration that cannot fit.
- Volumes: 1 to 100 GiB per disk, 10 disks and 100 GiB per application.
- Outgoing bandwidth: 1 Gbit/s per instance.
- Temporary files and logs: 512 MiB per instance.
Exact request and response fields, limits, and error responses are in the Management API reference.