update docker and readme

This commit is contained in:
github-tijlxyz 2023-11-04 17:49:31 +01:00
parent 6f22e60a3a
commit c14585ce34
6 changed files with 15 additions and 33 deletions

2
.gitignore vendored
View File

@ -1,6 +1,4 @@
whitelist.json
users.json
khatru-invite
.env
khatru-badgern-db
db

View File

@ -1,35 +1,16 @@
FROM node:latest AS ui-builder
# syntax=docker/dockerfile:1
FROM golang:1.21
WORKDIR /app
COPY go.mod go.sum ./
RUN go mod download
COPY . .
WORKDIR /app/ui
RUN yarn install
RUN yarn build
FROM golang:1.20 AS go-builder
WORKDIR /app
COPY . .
COPY --from=ui-builder /app/ui/dist /app/ui/dist
RUN go build -o app
FROM golang:1.20
WORKDIR /app
COPY --from=go-builder /app/app /app/app
COPY --from=ui-builder /app/ui/dist /app/ui/dist
RUN CGO_ENABLED=0 GOOS=linux go build -o /khatru-invite
EXPOSE 3334
CMD ["./app"]
CMD ["/khatru-invite"]

View File

@ -4,4 +4,4 @@ A relay based on [Khatru](https://github.com/fiatjaf/khatru) with a invite hiera
some notes before running:
1. configure the relay settings in `.env`
2. manually add someone to the `whitelist.json` file, like this: `[{"pk":"07adfda9c5adc80881bb2a5220f6e3181e0c043b90fa115c4f183464022968e6","invited_by":""}]`
2. manually add someone to the `users.json` file, like this: `{"07adfda9c5adc80881bb2a5220f6e3181e0c043b90fa115c4f183464022968e6":""}`

View File

@ -3,13 +3,13 @@ version: '3'
services:
khatru-invite:
restart: unless-stopped
build:
build:
context: .
dockerfile: Dockerfile
ports:
- 3334:3334
volumes:
- ./whitelist.json:/app/whitelist.json
- ./khatru-badgern-db:/app/khatru-badgern-db
- ./users.json:/app/users.json
- ./db:/app/db
env_file:
- .env

View File

@ -2,3 +2,4 @@ RELAY_NAME="Name of the Relay"
RELAY_DESCRIPTION="Description of the relay"
RELAY_PUBKEY="07adfda9c5adc80881bb2a5220f6e3181e0c043b90fa115c4f183464022968e6"
RELAY_CONTACT="email@example.com"
DOMAIN="example.com"

2
go.mod
View File

@ -2,6 +2,8 @@ module github.com/github-tijlxyz/khatru-invite
go 1.21.0
toolchain go1.21.3
require (
github.com/fiatjaf/eventstore v0.1.0
github.com/fiatjaf/khatru v0.0.4