fedi-feed-router/README.md
2025-06-30 20:29:55 +02:00

2.5 KiB

Lemmy Poster

A Laravel application for posting articles to Lemmy platforms.

Docker Deployment

Building the Image

docker build -t your-registry/lemmy-poster:latest .
docker push your-registry/lemmy-poster:latest

Docker Compose

Create a docker-compose.yml file:

services:
  app-web:
    image: your-registry/lemmy-poster:latest
    command: ["web"]
    ports:
      - "8000:8000"
    environment:
      - APP_ENV=production
      - APP_KEY=${APP_KEY}
      - DB_CONNECTION=mysql
      - DB_HOST=mysql
      - DB_PORT=3306
      - DB_DATABASE=lemmy_poster
      - DB_USERNAME=lemmy_user
      - DB_PASSWORD=${DB_PASSWORD}
      - QUEUE_CONNECTION=database
      - LEMMY_INSTANCE=${LEMMY_INSTANCE}
      - LEMMY_USERNAME=${LEMMY_USERNAME}
      - LEMMY_PASSWORD=${LEMMY_PASSWORD}
      - LEMMY_COMMUNITY=${LEMMY_COMMUNITY}
    depends_on:
      - mysql
    volumes:
      - storage_data:/var/www/html/storage/app
    restart: unless-stopped

  app-queue:
    image: your-registry/lemmy-poster:latest
    command: ["queue"]
    environment:
      - APP_ENV=production
      - APP_KEY=${APP_KEY}
      - DB_CONNECTION=mysql
      - DB_HOST=mysql
      - DB_PORT=3306
      - DB_DATABASE=lemmy_poster
      - DB_USERNAME=lemmy_user
      - DB_PASSWORD=${DB_PASSWORD}
      - QUEUE_CONNECTION=database
      - LEMMY_INSTANCE=${LEMMY_INSTANCE}
      - LEMMY_USERNAME=${LEMMY_USERNAME}
      - LEMMY_PASSWORD=${LEMMY_PASSWORD}
      - LEMMY_COMMUNITY=${LEMMY_COMMUNITY}
    depends_on:
      - mysql
    volumes:
      - storage_data:/var/www/html/storage/app
    restart: unless-stopped

  mysql:
    image: mysql:8.0
    environment:
      - MYSQL_DATABASE=lemmy_poster
      - MYSQL_USER=lemmy_user
      - MYSQL_PASSWORD=${DB_PASSWORD}
      - MYSQL_ROOT_PASSWORD=${DB_ROOT_PASSWORD}
    volumes:
      - mysql_data:/var/lib/mysql
    restart: unless-stopped

volumes:
  mysql_data:
  storage_data:

Environment Variables

Create a .env file with:

APP_KEY=your-app-key-here
DB_PASSWORD=your-db-password
DB_ROOT_PASSWORD=your-root-password
LEMMY_INSTANCE=your-lemmy-instance.com
LEMMY_USERNAME=your-lemmy-username
LEMMY_PASSWORD=your-lemmy-password
LEMMY_COMMUNITY=your-target-community

Generate the APP_KEY:

openssl rand -base64 32 | tr -d '='

Deployment

  1. Build and push the image
  2. Copy the docker-compose.yml to your server
  3. Create the .env file with your environment variables
  4. Run: docker-compose up -d

The web interface will be available on port 8000, ready for CloudFlare tunnel configuration.