By default, the Tymeslot Docker image ships with PostgreSQL embedded directly in the container. On first start, the entrypoint script initialises a local PostgreSQL cluster, stores its data in theDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/Tymeslot/tymeslot/llms.txt
Use this file to discover all available pages before exploring further.
tymeslot_pg named volume, and Tymeslot connects to it over localhost. This is the simplest possible setup and works well for personal deployments and small teams.
When to use an external database
Consider switching to an external PostgreSQL instance when you need:- High availability — managed services (AWS RDS Multi-AZ, Azure Database for PostgreSQL, DigitalOcean Managed Databases) provide automatic failover that the embedded single-node PostgreSQL cannot.
- Managed backups — cloud providers handle point-in-time recovery and snapshot retention automatically.
- Existing infrastructure — you already run a shared PostgreSQL cluster and want Tymeslot to use it rather than operating a separate embedded database.
- Host-path volume compatibility — the embedded PostgreSQL can fail to initialise on Docker Desktop, rootless Docker, or SELinux-enforcing hosts when a bind-mount is used for the data directory. An external database sidesteps this entirely.
How detection works
Tymeslot decides whether to start the embedded PostgreSQL based on the value ofDATABASE_HOST:
DATABASE_HOST value | Behaviour |
|---|---|
localhost (default) or 127.0.0.1 | The container starts and manages embedded PostgreSQL |
| Any other hostname or IP | The container skips embedded PostgreSQL and connects to the external host |
DATABASE_HOST at an external host is sufficient.
Required environment variables
Set all five variables when connecting to an external database:Hostname or IP address of the PostgreSQL server. Any value other than
localhost or 127.0.0.1 triggers external-database mode.PostgreSQL port. Change this only if your provider uses a non-standard port.
Name of the database Tymeslot will connect to. Must already exist.
PostgreSQL username. Must already exist and have full privileges on
POSTGRES_DB.Password for
POSTGRES_USER.Preparing the external database
Before starting Tymeslot, connect to your PostgreSQL instance as a superuser and run:Connection pool tuning
Number of database connections in the Ecto pool. The runtime default is
60, which supports Tymeslot’s background job concurrency. For external managed databases with tighter connection limits, lower this value and ensure your PostgreSQL max_connections is set above it. A good rule of thumb: max_connections should be at least DATABASE_POOL_SIZE + 10 to leave headroom for administrative connections.Network and firewall requirements
The Tymeslot container must be able to reach the database host onDATABASE_PORT (default 5432). Common things to check:
- Security groups / firewall rules — allow inbound TCP on port 5432 from the Tymeslot container’s IP or security group.
- PostgreSQL
pg_hba.conf— ensure a rule allows the Tymeslot user to connect from the container’s IP with password authentication. - DNS resolution — the
DATABASE_HOSTvalue must resolve from inside the container. Use a private DNS hostname for managed services (e.g. an AWS VPC endpoint) rather than a public hostname when possible.
Provider examples
- AWS RDS
- DigitalOcean Managed Postgres
After creating an RDS PostgreSQL instance (version 14 or later), create the database and user as shown above, then set:Make sure the RDS security group allows inbound traffic on port 5432 from your Tymeslot host’s security group or IP address.
RDS enforces SSL for connections by default on recent engine versions. Tymeslot’s Ecto adapter negotiates SSL automatically when the server requests it.
Disabling the embedded PostgreSQL
WhenDATABASE_HOST points to an external server, the container entrypoint automatically skips initialising and starting the internal PostgreSQL process. The tymeslot_pg volume is no longer needed and can be left detached or removed. You only need the tymeslot_data volume for uploaded files and application data: