From 6da77cb90290bef632a47279806483fc3869910a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arda=20K=C4=B1l=C4=B1=C3=A7da=C4=9F=C4=B1?= Date: Wed, 13 May 2026 00:16:39 +0300 Subject: [PATCH] chore: make compose.yml support both pre-built images or building locally (#1184) --- DOCKER.md | 34 ++++++++++++++++++++-------------- compose.yml | 10 +++++----- 2 files changed, 25 insertions(+), 19 deletions(-) diff --git a/DOCKER.md b/DOCKER.md index 1eb7fc14..2f3e4111 100644 --- a/DOCKER.md +++ b/DOCKER.md @@ -2,32 +2,27 @@ Run your own prompts.chat instance using Docker Compose. +[`compose.yml`](/compose.yml) supports both the pre-built container image being fetched from ghcr.io, or being built locally. + ## Quick Start +### To build locally + ```bash git clone https://github.com/f/prompts.chat.git cd prompts.chat -docker compose up -d +docker compose up -d --build ``` Open http://localhost:4444 in your browser. -## Using a Pre-built Image +### Using a Pre-built Image -Edit `compose.yml` and replace the `build` block with the published image: - -```yaml -services: - app: - # build: - # context: . - # dockerfile: docker/Dockerfile - image: ghcr.io/f/prompts.chat:latest -``` - -Then run: +Simply remove the `--build` flag from the command: ```bash +git clone https://github.com/f/prompts.chat.git +cd prompts.chat docker compose up -d ``` @@ -45,6 +40,17 @@ docker run -d \ prompts.chat ``` +Or if you simply want to use the pre-built image: + +```bash +docker run -d \ + --name prompts \ + -p 4444:3000 \ + -e DATABASE_URL="postgresql://user:pass@your-db-host:5432/prompts?schema=public" \ + -e AUTH_SECRET="$(openssl rand -base64 32)" \ + ghcr.io/f/prompts.chat:latest +``` + ## Custom Branding All branding is configured via `PCHAT_*` environment variables at runtime -- no rebuild needed. diff --git a/compose.yml b/compose.yml index eef02837..b7c8af62 100644 --- a/compose.yml +++ b/compose.yml @@ -18,11 +18,11 @@ services: app: image: ghcr.io/f/prompts.chat:latest - # To build locally instead of using the pre-built image, comment out - # the 'image' line above and uncomment the build block below: - # build: - # context: . - # dockerfile: docker/Dockerfile + # By default, uses the pre-built image above. To build locally instead, + # run: docker compose up -d --build + build: + context: . + dockerfile: docker/Dockerfile restart: unless-stopped ports: - "${PORT:-4444}:3000"