From 8e7f403cc5ab6e7e6c7c40af7361a7ba6bf22f94 Mon Sep 17 00:00:00 2001 From: Jake Howard Date: Sun, 9 Aug 2020 09:39:19 +0100 Subject: [PATCH] Note about actually creating the DB Causes errors otherwise! --- content/posts/self-hosting-plausible/index.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/content/posts/self-hosting-plausible/index.md b/content/posts/self-hosting-plausible/index.md index 1a3ebe4..e1d8686 100644 --- a/content/posts/self-hosting-plausible/index.md +++ b/content/posts/self-hosting-plausible/index.md @@ -64,12 +64,13 @@ This is the point we diverge pretty hard from what's defined in both the `docker 1. Start up everything except Plausible itself (`docker-compose up -d db clickhouse`) 2. Enter the Plausible container (`docker-compose run plausible sh`) -3. Run migrations (`/entrypoint.sh db migrate`) -4. Define your user credentials as environment variables: +3. Create databases (`/entrypoint.sh db createdb`) +4. Run migrations (`/entrypoint.sh db migrate`) +5. Define your user credentials as environment variables: - `$ADMIN_USER_NAME` - `$ADMIN_USER_EMAIL` - `$ADMIN_USER_PWD` -5. Create your admin user (`/entrypoint.sh db init-admin`) +6. Create your admin user (`/entrypoint.sh db init-admin`) These steps only need to be done once, during application setup. After this, the command must be changed to automatically run migrations on start up. This ensures the database schema and running application are always in sync, and are updated with the container. This can be done by changing the `docker-compose.yml` [like so](https://github.com/RealOrangeOne/infrastructure/commit/384a07b513e42942625df07184ae502957d41013).