Skip to content

armgit / lyftr

Public Imported from GitHub
0

Self-hosted fitness tracker. Log workouts, track nutrition, and monitor progress. Docker deployment, mobile-friendly.

1.2 KB
Raw Blame
version: '3.8'

services:
  backend:
    image: cwlumm/lyftr-backend:latest
    build: ./backend
    restart: unless-stopped
    volumes:
      - ./data:/app/data
    environment:
      - ENV=production
      - PORT=3000
      - JWT_SECRET=${JWT_SECRET}
      - CORS_ORIGIN=${CORS_ORIGIN:-http://localhost}
      - DB_TYPE=sqlite
      - DB_PATH=/app/data/lyftr.db
      - REGISTRATION=${REGISTRATION:-open}
      - DEMO_MODE=${DEMO_MODE:-false}
      - OEDB_BASE_URL=${OEDB_BASE_URL:-}
    expose:
      - "3000"
    healthcheck:
      test: ["CMD", "wget", "-qO-", "http://localhost:3000/health"]
      interval: 30s
      timeout: 10s
      retries: 3

  frontend:
    image: cwlumm/lyftr-frontend:latest
    # Repo root, not ./web — the build installs the npm workspace so it can reach
    # packages/shared. Service name stays `frontend` so the CI bake cache flags match.
    build:
      context: .
      dockerfile: web/Dockerfile
    restart: unless-stopped
    environment:
      # host:port the frontend nginx proxies /api to. Must match the backend's PORT.
      - BACKEND_ORIGIN=${BACKEND_ORIGIN:-backend:3000}
    ports:
      - "${PORT:-80}:80"
    depends_on:
      backend:
        condition: service_healthy