OpenStock Docker & Self-Hosted Deployment

GitHub

OpenStock is an open-source alternative to expensive market platforms. Track real-time prices, set personalized alerts, and explore detailed company...

11,261 stars TypeScript TypeScript 1 file ยท ~4,120 tokens #coderabbit#inngest#nextjs#shadcn-ui#stock-market#tailwindcss
RAW Compose
1. Pull Image (DOCKERHUB) docker pull library/mongo
2. Docker Run (1-Click Launch) docker run -d --name openstock -p 3000:3000 --restart always mongo:7
3. Podman Run podman run -d --name openstock -p 3000:3000 --restart always mongo:7
4. Skopeo Inspect (Zero-Pull Manifest) skopeo inspect docker://docker.io/library/mongo:7
5. ORAS Pull (OCI Artifact) oras pull mongo:7
6. Compose Deployment docker compose up -d
docker-compose.yml
Download .yml
services:
  openstock:
    build:
      context: .
      args:
        # Fixed into the app at build time; set it in .env, then rebuild
        NEXT_PUBLIC_OPENSTOCK_DATA_MODE: ${NEXT_PUBLIC_OPENSTOCK_DATA_MODE:-cached}
    ports:
      - "3000:3000"
    env_file:
      - .env
    restart: unless-stopped
    depends_on:
      mongodb:
        condition: service_healthy

  mongodb:
    image: mongo:7
    container_name: mongodb
    restart: unless-stopped
    environment:
      MONGO_INITDB_ROOT_USERNAME: root
      # Set MONGO_ROOT_PASSWORD in .env and use the same password in MONGODB_URI. Only read on the first start.
      MONGO_INITDB_ROOT_PASSWORD: ${MONGO_ROOT_PASSWORD:-example}
    # No published port: only the app reaches MongoDB, over the Compose network. To use mongosh or Compass from
    # your machine, add  ports: ["127.0.0.1:27017:27017"]  (a bare "27017:27017" exposes it on every interface).
    volumes:
      - mongo-data:/data/db
    healthcheck:
      test: ["CMD", "mongosh", "--quiet", "--eval", "db.adminCommand('ping')"]
      interval: 10s
      timeout: 5s
      retries: 5

volumes:
  mongo-data: