From 626bc03dbdd993b350e0581079de86887895a89e Mon Sep 17 00:00:00 2001 From: Jesse Wierzbinski Date: Wed, 13 Mar 2024 06:36:38 -1000 Subject: [PATCH] Update README about new Postgres images --- README.md | 30 ++++-------------------------- 1 file changed, 4 insertions(+), 26 deletions(-) diff --git a/README.md b/README.md index 83a9e54d..83b2b179 100644 --- a/README.md +++ b/README.md @@ -96,35 +96,13 @@ bun install 3. Set up a PostgreSQL database, using the `pg_uuidv7` extension -You may use the following [Dockerfile](Postgres.Dockerfile) to set it up: - -```Dockerfile -# Use the latest Postgres Docker image based on Alpine -FROM postgres:alpine +Lysand offers a pre-made Docker image for PostgreSQL with the extension already installed. Use `ghcr.io/lysand-org/postgres:main` as your Docker image name to use it. -# Set working directory -WORKDIR /usr/src/app +You may otherwise use this [Dockerfile](Postgres.Dockerfile) to set it up. -# Install curl -RUN apk add --no-cache curl +1. Copy the `config.toml.example` file to `config.toml` and fill in the values (you can leave most things to the default, but you will need to configure things such as the database connection) -RUN cd "$(mktemp -d)" \ - && curl -LO "https://github.com/fboulnois/pg_uuidv7/releases/download/v1.3.0/{pg_uuidv7.tar.gz,SHA256SUMS}" \ - && tar xf pg_uuidv7.tar.gz \ - && sha256sum -c SHA256SUMS \ - && PG_MAJOR=$(pg_config --version | sed 's/^.* \([0-9]\{1,\}\).*$/\1/') \ - && cp "$PG_MAJOR/pg_uuidv7.so" "$(pg_config --pkglibdir)" \ - && cp sql/pg_uuidv7--1.3.sql pg_uuidv7.control "$(pg_config --sharedir)/extension" -# Add a script to run the CREATE EXTENSION command -RUN echo '#!/bin/sh\npsql -U "$POSTGRES_USER" -d "$POSTGRES_DB" -c "CREATE EXTENSION pg_uuidv7;"' > /docker-entrypoint-initdb.d/init.sh - -# Make the entrypoint script executable -RUN chmod +x /docker-entrypoint-initdb.d/init.sh -``` - -4. Copy the `config.toml.example` file to `config.toml` and fill in the values (you can leave most things to the default, but you will need to configure things such as the database connection) - -5. Run migrations: +2. Run migrations: ```bash bun migrate