PrimalHQ / primal-caching-service

Primal’s caching service for Nostr connects to the specified set of relays, collects all events in real time, stores them locally, and makes them available to nostr clients through a web socket-based API.
https://primal.net
MIT License
85 stars 13 forks source link

can we get a docker-compose.yml sample file? #11

Closed ralyodio closed 9 months ago

ralyodio commented 9 months ago

I'd like to run this with docker-compose

ralyodio commented 9 months ago

I've tried this but it just does exit 0.

docker-compose.yml:

version: '3.8'

services:
  follow-cache:
    image: nixos/nix
    build: .
    volumes:
      - .:/app
    working_dir: /app
    ports:
      - "127.0.0.1:7702:8801"
    environment:
      - PRIMALSERVER_HOST=0.0.0.0
    command: >
      nix --extra-experimental-features 'nix-command flakes' develop -c sh -c '$start_primal_caching_service'
    networks:
      - follows_network
networks:
    follows_network:
      name: follows_network

Dockerfile

# Use the specified base image
FROM nixos/nix

# Set an environment variable
ENV PRIMALSERVER_HOST=0.0.0.0

# Set the working directory in the container
WORKDIR /app

# Copy the current directory contents into the container at /app
COPY . /app

# Run the specified command when the container launches
CMD ["nix", "--extra-experimental-features", "nix-command flakes", "develop", "-c", "sh", "-c", "$start_primal_caching_service"]

# Expose the port the server is running on
EXPOSE 8801

DOes anyone know how to fix?

ralyodio commented 9 months ago

Bounty here: 10k sats https://resolvr.io/b/naddr1qprkgmmrddjhycm0d4cx7um994skuepdv3hkx6m9wfnxjmr994jhsctdwpkx2ttxdaez6urjd9kkzmpdvdskx6r994ex2ur094nrzdekv3nxverxvgenzqgdwaehxw309ahx7uewd3hkcq3q9p3l898yf76s73m5pr0ru03a0y8ps6c3se6xcekz8d8v2f676kxsxpqqqp6kygkc83r

pritk commented 9 months ago
version: '3.8'

services:
  follow-cache:
    image: nixos/nix
    volumes:
      - .:/app
      - ./var/root:/root
    working_dir: /app
    ports:
      - "127.0.0.1:7702:8801"
    environment:
      - PRIMALSERVER_HOST=0.0.0.0
    command: >
      nix --extra-experimental-features 'nix-command flakes' develop -c sh -c '$$start_primal_caching_service'
    stdin_open: true
    tty: true
    networks:
      - follows_network
networks:
    follows_network:
      name: follows_network

then you can do, for interactive use:

docker-compose run follow-cache

or for non-interactive use:

docker-compose up

ralyodio commented 9 months ago

send me your zap address.

pritk commented 9 months ago

no thanks. you wrote most of docker-compose.yml anyway :)

jurjendevries commented 8 months ago

@ralyodio You forgot to close the bounty https://resolvr.io/b/naddr1qvzqqqr4vgpzq2rr7w2wgna4parhgzx78clr67gwrp43rpn5d3nvyw6wc5n4a4vdqyxhwumn8ghj7mn0wvhxcmmvqy28wumn8ghj7un9d3shjtnyv9kh2uewd9hsq3myda3kketjvdhk6ur0wdjj6ctwvskkgmmrddjhyenfd3jj6etcv9khqmr994nx7u3dwpexjmtpdskkxctrdpjj6un9wphj6e33xumxgenxv3nxyve33440cv ..

ralyodio commented 8 months ago

closed it. their close broken was broken but its working finally.