Skip to content

Commit

Permalink
docs: provide better documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
tefkah committed Feb 19, 2025
1 parent 9961154 commit 503022f
Show file tree
Hide file tree
Showing 4 changed files with 104 additions and 42 deletions.
83 changes: 83 additions & 0 deletions self-host/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,11 @@ ASSETS_REGION=us-east-1 # leave this unchanged, unless you are hosting files on

Then, after running `docker compose up -d`, you should be able to visit the MinIO console at `http://localhost:9001`.

#### SSL/Caddy

> [!NOTE]
> Disabled by default, see later section for more information
#### Email

> [!NOTE]
Expand Down Expand Up @@ -215,3 +220,81 @@ You can technically leave the email provider blank, but this will disable the em
#### Other

...

### Disable services you don't want or need

By default, a number of services are enabled in `docker-compose.yml` that you may not want or need.

Here a short list of the built in services:

#### Postgres Database

By default, we will spin up a postgres database in a container.

You may want to use your own postgres database instead, in which case you can disable this by removing the `db` service from the `docker-compose.yml` file, and removing the

```yml
db:
condition: service_started
```
from the `depends_on` section of the `platform` service.

```yml
platform:
depends_on:
db:
condition: service_started
```

#### MinIO

By default, we will spin up a MinIO container to host files locally.

You can choose to instead choose to use any other S3-compatible storage service, in which case you can disable this by removing the `minio` and `minio-init` services from the `docker-compose.yml` file.

Be sure to follow the instructions above for configuring the environment variables for your S3-compatible storage service.

### Start the services for the first time

Now you should be ready to start the services for the first time!

```sh
docker compose up -d
```

Everything should start up without any issues.

You should now be able to visit Platform at `http://localhost:3000`, and browse your files at `http://localhost:9001` (if you are using the built-in MinIO service).

But, as you might have noticed: you cannot login yet!

This is because you need to create an admin user.

### Create an admin user

First, make the script executable:

```sh
chmod +x ./create-admin.sh
```

Then, run the script:

```sh
./create-admin.sh
```

You will be prompted to enter an email, password, first name, and last name.

Once you have done this, you should be able to login to Platform at `http://localhost:3000` (or the URL you have set up) with the email and password you just created.

### Create a community

Navigate to `http://localhost:3000/communities` and create a community.

### Go to your new community

Navigate to `http://localhost:3000/c/your-community-slug` and you should see the community dashboard!

Congrats! You're ready to start using Platform!
5 changes: 3 additions & 2 deletions self-host/create-admin.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#!/bin/bash
set -e

source .env

# Prompt for admin credentials
read -p "Enter admin email: " ADMIN_EMAIL
read -s -p "Enter admin password: " ADMIN_PASSWORD
Expand All @@ -16,5 +18,4 @@ docker compose run --rm \
-e ADMIN_LASTNAME="$ADMIN_LASTNAME" \
platform-migrations pnpm --filter core exec tsx prisma/create-admin-user.cts

echo "✨ Done! You can now start the application with:"
echo "docker compose up -d"
echo "✨ Done! You can now login to Platform at $PUBPUB_URL"
38 changes: 18 additions & 20 deletions self-host/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ services:
condition: service_started
platform-jobs:
condition: service_started
minio:
condition: service_healthy
platform-migrations:
condition: service_completed_successfully
platform: linux/amd64
Expand Down Expand Up @@ -80,27 +78,27 @@ services:
ports:
- "5432:5432" # you can choose another port if you want, just make sure the first one matches the POSTGRES_PORT in .env

# reverse proxy
# recommended reverse proxy solution
# can be removed if you manually set up a reverse proxy like nginx instead
# useful if you want your assets, platform, and site to be on the same domain
# but with different paths
caddy:
image: caddy:latest
depends_on:
- platform
- platform-jobs
- minio
env_file:
- path: .env
required: true
ports:
- "443:443"
volumes:
- ./caddy:/etc/caddy
- caddy-data:/data
- caddy-config:/config
networks:
- app-network
# caddy:
# image: caddy:latest
# depends_on:
# - platform
# - platform-jobs
# - minio
# env_file:
# - path: .env
# required: true
# ports:
# - "443:443"
# volumes:
# - ./caddy:/etc/caddy
# - caddy-data:/data
# - caddy-config:/config
# networks:
# - app-network

# assets storage
# can be removed if you manually set up a storage service like s3 or minio instead
Expand Down
20 changes: 0 additions & 20 deletions self-host/setup.sh

This file was deleted.

0 comments on commit 503022f

Please sign in to comment.