Skip to content
Start free

Aptible

Open in ClaudeOpen in ChatGPT

Aptible is a platform for running apps with the controls that compliance frameworks such as HIPAA and SOC 2 ask for. DocSpring Enterprise runs there as an app, with Aptible’s managed PostgreSQL and Redis, and an S3 bucket in your own AWS account for files. The files are in the aptible folder of DocSpring/docspring-enterprise.

The folder is a Dockerfile deploy: Aptible builds an image that starts FROM the DocSpring Enterprise image and adds supercronic, which runs the scheduled tasks in a cron service, since Aptible has no scheduler of its own. Procfile lists the services, and .aptible.yml runs the release command before each deploy.

  • An Aptible account and the Aptible CLI, signed in with aptible login.
  • Your license key and Docker Hub credentials, which we email you.
  • An S3 bucket, set up as the Requirements page describes, and an IAM user with access to that bucket only.

Aptible deploys the root of a git repository, so copy the folder into a repository of its own:

git clone https://github.com/DocSpring/docspring-enterprise.git
cp -R docspring-enterprise/aptible docspring-aptible
cd docspring-aptible && git init && git add -A && git commit -m 'DocSpring Enterprise'

Create the app, PostgreSQL and Redis:

aptible apps:create docspring
aptible db:create docspring-postgres --type postgresql --version 17
aptible db:create docspring-redis --type redis --version 7.0
aptible db:url docspring-postgres # the DATABASE_URL
aptible db:url docspring-redis # the REDIS_URL

Set its configuration. Generate the two keys once, and keep a copy of the encryption key somewhere safe:

aptible config:set --app docspring \
APTIBLE_PRIVATE_REGISTRY_USERNAME='<Docker Hub username from DocSpring>' \
APTIBLE_PRIVATE_REGISTRY_PASSWORD='<Docker Hub token from DocSpring>' \
DOCSPRING_LICENSE='<your license key>' \
DOCSPRING_DOMAIN_NAME=docspring.example.com \
DOCSPRING_FORCE_SSL=true \
DATABASE_URL='<from aptible db:url>' \
REDIS_URL='<from aptible db:url>' \
SECRET_KEY_BASE="$(openssl rand -hex 64)" \
DOCSPRING_SUBMISSION_DATA_ENCRYPTION_KEY="$(openssl rand -hex 32)" \
DOCSPRING_ADMIN_EMAIL=admin@example.com \
DOCSPRING_ADMIN_PASSWORD='<a password for the first admin>' \
DOCSPRING_AWS_UPLOADS_S3_BUCKET='<bucket>' \
DOCSPRING_AWS_UPLOADS_S3_REGION='<region>' \
DOCSPRING_AWS_ACCESS_KEY_ID='<access key ID>' \
DOCSPRING_AWS_ACCESS_KEY_SECRET='<secret access key>'

Then add your email settings the same way.

Deploy, and give web an HTTPS endpoint on port 4001:

git remote add aptible "$(aptible apps:info docspring | sed -n 's/^Git Remote: //p')"
git push aptible main
aptible endpoints:https:create --app docspring --default-domain web

Use --managed-tls with your own domain instead of --default-domain. Scale the services (memory in MB):

aptible apps:scale --app docspring --container-count 2 --container-size 2048 web
aptible apps:scale --app docspring --container-count 2 --container-size 4096 worker
aptible apps:scale --app docspring --container-count 1 --container-size 1024 worker_gj
aptible apps:scale --app docspring --container-count 1 --container-size 1024 cron

Sign in with the admin email and password, and change the password.

Read the release notes, change the version in the Dockerfile’s FROM line, commit, and git push aptible main. Aptible runs the release command before the new containers start.

  • Aptible doesn’t let containers add Linux capabilities, so they can’t add their firewall rule for the cloud metadata address, and log a warning at startup. Aptible’s own network isolation applies instead.
  • worker_gj needs a direct database connection: use the database’s own URL, not a connection pooler’s.
  • We don’t test on Aptible ourselves. Tell us at support@docspring.com if something in this guide doesn’t match what you see.