Last active
February 22, 2026 00:42
-
-
Save Seneral/06a9c239790fddd2233a78c0b944a444 to your computer and use it in GitHub Desktop.
Example setup of a lightning+postgres docker-compose setup - The matrix proxy isn't working yet, so the nginx setup is not needed yet - fluxer support requires this fork for now: https://codeberg.org/Seneral/lightning
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| x-db-credentials: &db-credentials | |
| POSTGRES_USER: &db-user PICK_A_USER | |
| POSTGRES_PASSWORD: &db-password PICK_A_PW | |
| POSTGRES_DB: &db-name PICK_A_NAME | |
| services: | |
| # Bridge | |
| lightning: | |
| image: codeberg.org/jersey/lightning:latest | |
| container_name: lightning_bridge | |
| restart: unless-stopped | |
| ports: | |
| - "127.0.0.1:7545:7545" # This is the internal matrix proxy_port | |
| networks: | |
| - lightning | |
| depends_on: | |
| db: | |
| condition: service_healthy | |
| volumes: | |
| - ./config:/data | |
| # Postgres database | |
| db: | |
| image: postgres:18-alpine | |
| container_name: lightning_db | |
| restart: unless-stopped | |
| expose: | |
| - "5432" | |
| networks: | |
| - lightning | |
| environment: | |
| <<: *db-credentials | |
| healthcheck: | |
| test: ["CMD-SHELL", "pg_isready -d $${POSTGRES_DB} -U $${POSTGRES_USER}"] | |
| interval: 10s | |
| timeout: 5s | |
| retries: 6 | |
| volumes: | |
| - type: volume | |
| source: lightning-data | |
| target: /var/lib/postgresql | |
| networks: | |
| lightning: | |
| volumes: | |
| lightning-data: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| database = "postgres://PICK_A_USER:PICK_A_PW@db:5432/PICK_A_NAME" | |
| prefix = "!" | |
| username = "lightning" | |
| [[plugins]] | |
| type = "discord" | |
| name = "Discord" | |
| config.token = "nay" | |
| [[plugins]] | |
| type = "discord" | |
| name = "Fluxer" | |
| config.product = "fluxer" | |
| config.token = "nay" | |
| [[plugins]] | |
| type = "stoat" | |
| config.token = "nay" | |
| [[plugins]] | |
| type = "matrix" | |
| config.access_token = "nay" | |
| config.homeserver = "https://matrix-client.matrix.org" | |
| config.mxid = "@botname:matrix.org" | |
| config.proxy_url = "https://your.bridge.domain/matrix" | |
| config.proxy_port = "7545" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| upstream lightning { | |
| server localhost:7545; | |
| } | |
| server { | |
| listen 443 ssl; | |
| server_name your.bridge.domain; | |
| ssl_certificate /etc/letsencrypt/live/your.bridge.domain/fullchain.pem; | |
| ssl_certificate_key /etc/letsencrypt/live/your.bridge.domain/privkey.pem; | |
| location / { | |
| return 404; | |
| } | |
| # Serve public lightning endpoints | |
| location ~* ^/(matrix) { | |
| proxy_pass http://lightning; | |
| proxy_set_header Host $http_host; | |
| proxy_set_header X-Real-IP $remote_addr; | |
| proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment