Initial commit: Lightning Lottery - Bitcoin Lightning Network powered lottery
Features: - Lightning Network payments via LNbits integration - Provably fair draws using CSPRNG - Random ticket number generation - Automatic payouts with retry/redraw logic - Nostr authentication (NIP-07) - Multiple draw cycles (hourly, daily, weekly, monthly) - PostgreSQL and SQLite database support - Real-time countdown and payment animations - Swagger API documentation - Docker support Stack: - Backend: Node.js, TypeScript, Express - Frontend: Next.js, React, TailwindCSS, Redux - Payments: LNbits
This commit is contained in:
75
docker-compose.yml
Normal file
75
docker-compose.yml
Normal file
@@ -0,0 +1,75 @@
|
||||
version: '3.8'
|
||||
|
||||
services:
|
||||
postgres:
|
||||
image: postgres:14-alpine
|
||||
container_name: lightning-lotto-db
|
||||
environment:
|
||||
POSTGRES_DB: lightning_lotto
|
||||
POSTGRES_USER: lottery_user
|
||||
POSTGRES_PASSWORD: lottery_password
|
||||
volumes:
|
||||
- postgres_data:/var/lib/postgresql/data
|
||||
- ./back_end/src/database/schema.sql:/docker-entrypoint-initdb.d/schema.sql
|
||||
ports:
|
||||
- "5432:5432"
|
||||
networks:
|
||||
- lightning-lotto-network
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", "pg_isready -U lottery_user -d lightning_lotto"]
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
|
||||
backend:
|
||||
build:
|
||||
context: ./back_end
|
||||
dockerfile: Dockerfile
|
||||
container_name: lightning-lotto-backend
|
||||
depends_on:
|
||||
postgres:
|
||||
condition: service_healthy
|
||||
environment:
|
||||
APP_PORT: 3000
|
||||
APP_BASE_URL: ${APP_BASE_URL:-http://localhost:3000}
|
||||
FRONTEND_BASE_URL: ${FRONTEND_BASE_URL:-http://localhost:3001}
|
||||
NODE_ENV: production
|
||||
DATABASE_URL: postgresql://lottery_user:lottery_password@postgres:5432/lightning_lotto
|
||||
LNBITS_API_BASE_URL: ${LNBITS_API_BASE_URL}
|
||||
LNBITS_ADMIN_KEY: ${LNBITS_ADMIN_KEY}
|
||||
LNBITS_WEBHOOK_SECRET: ${LNBITS_WEBHOOK_SECRET}
|
||||
JWT_SECRET: ${JWT_SECRET}
|
||||
ADMIN_API_KEY: ${ADMIN_API_KEY}
|
||||
DEFAULT_TICKET_PRICE_SATS: ${DEFAULT_TICKET_PRICE_SATS:-1000}
|
||||
DEFAULT_HOUSE_FEE_PERCENT: ${DEFAULT_HOUSE_FEE_PERCENT:-5}
|
||||
DRAW_SCHEDULER_INTERVAL_SECONDS: 60
|
||||
CYCLE_GENERATOR_INTERVAL_SECONDS: 300
|
||||
ports:
|
||||
- "3000:3000"
|
||||
networks:
|
||||
- lightning-lotto-network
|
||||
restart: unless-stopped
|
||||
|
||||
frontend:
|
||||
build:
|
||||
context: ./front_end
|
||||
dockerfile: Dockerfile
|
||||
container_name: lightning-lotto-frontend
|
||||
depends_on:
|
||||
- backend
|
||||
environment:
|
||||
NEXT_PUBLIC_API_BASE_URL: ${NEXT_PUBLIC_API_BASE_URL:-http://localhost:3000}
|
||||
NEXT_PUBLIC_APP_BASE_URL: ${NEXT_PUBLIC_APP_BASE_URL:-http://localhost:3001}
|
||||
ports:
|
||||
- "3001:3000"
|
||||
networks:
|
||||
- lightning-lotto-network
|
||||
restart: unless-stopped
|
||||
|
||||
volumes:
|
||||
postgres_data:
|
||||
|
||||
networks:
|
||||
lightning-lotto-network:
|
||||
driver: bridge
|
||||
|
||||
Reference in New Issue
Block a user