How to configure databases with HCS
Databases
Here you can find the documentation for databases in HCS.
You can configure a database with a simple click. HCS supports the following databases:
PostgreSQL
MySQL
MariaDB
MongoDB
Redis
Ports Mapping vs Public Port
Ports Mapping
Ports mapping is using the Docker port mapping feature. It is used to map the container port to the host port. For example, if you set the port mapping to 8080:80
, the container port 80
will be mapped to the host port 8080
.
Public Port
Public port is used to expose the container port to the internet, by starting an Nginx TCP proxy.
Which one should I use?
Port mappings makes the connection/port permanent (you need to restart your database to change it).
The public port makes the connection/port dynamic (you can change it without restarting the database, HCS will restart the Nginx TCP proxy for you).
Access database during builds
If you are using Nixpacks
build pack, you have two ways to access your database during builds:
Database & your application are
in the same network
: You can reach it using theinternal URL
provided by HCS.Database & your application
are not in the same network
: You need to set enable yout database to beAccessible over the internet
and use thepublic URL
provided by HCS.
Last updated