If your app needs to persist data between restarts or upgrades, it can do so by requesting access to a part of the Portal's file system. Use this feature for a database or user-data in the shape of files. Shared directories allow data exchange between apps.
For each installed app, Portal creates a separate app-directory inside its file system
and allows the app to mount subdirectories of that directory into itself
by specifying them in the
This feature is based on Docker bind mounts.
Initially, these directories will be empty and your app can arbitrarily read and write inside them. If your app is stopped, the mounted directories remain intact and will still be there when your app restarts. If you release a new version of your app, it is your job to detect whether the content of the mounted directories was created by the old version and migrate it if needed.
You might not want to run your application as root inside your container but as some other user. In this case, it would not have access to the mounted directories, since they are owned by root. In order to allow access, you can change the mounted directories' owner by defining its user and group id. Set it to the values of the user that runs the app.
Use these app-specific directories to persist data that is used only by your app.
1 2 3 4 5 6 7 8 9 10
Portal defines a set of shared directories to which your app can request access.
They are mounted inside your app's file system at a path that is specified in the
Use these directories to access preexisting user data and share data with other apps that have access to the same directories.
Available shared directories are:
1 2 3 4 5 6 7 8 9
Each Portal runs some built-in services that your app may use. For example, your app can get its own database at the Portal's Postgres instance and use it to store its data. Take a look at the section about Portal's internal services for more information.