Start a database server¶
SightPress keeps its data in a single file on disk (an SQLite database), so it doesn't need a separate database server. If you want to try one, SightPress can start MySQL, MariaDB or PostgreSQL for you. This guide shows you how.
Not used yet
At this stage SightPress starts the database server but doesn't store anything in it. You can check that it runs. Later versions will let you use it for your sites.
Start SightPress with a database¶
- If SightPress is running, stop it with
docker compose --profile "*" down. -
In the
skeletonfolder, type one of these commands:For MariaDB, use
--profile mariadb. For PostgreSQL, use--profile postgres. -
Wait until the text stops scrolling. The first time, Docker downloads the database, which can take a few minutes. You should see lines starting with
mysql-1(ormariadb-1, orpostgres-1) among the others.
To start it in the background instead, add --detach --wait to the end of the command.
Check that the database runs¶
- Open a second terminal and go to the
skeletonfolder. -
Type:
-
You should see a row for the database, such as
mysql, with(healthy)in the STATUS column. If it says(health: starting), wait a few seconds and type the command again.
When you start SightPress without --profile, no database server runs, and this table has no database row.
The database settings¶
The database is created with these values. You can change them in the .env file before the first start (see
Change the ports SightPress uses for how to create and edit .env).
| Setting | Default | What it is |
|---|---|---|
DB_NAME |
sightpress |
The name of the database |
DB_USER |
sightpress |
The user name |
DB_PASSWORD |
sightpress |
The user's password |
DB_ROOT_PASSWORD |
sightpress-root |
The administrator password (MySQL, MariaDB) |
The database server can only be reached by the other SightPress containers, not from your computer or your network.
Stop the database¶
Type docker compose --profile "*" down. This stops SightPress and the database. The data in the database is kept
for next time.