Skip to content

Add a Docker / containerisation setup for reproducible deployment #7

@Codex-Crusader

Description

@Codex-Crusader

Problem

There is no Dockerfile, docker-compose.yml, or container configuration of any kind. Users must manually configure a Python environment, which is error-prone (especially given the unpinned dependencies — see issue #5). The README shows a "LINK TO LIVE DEPLOYMENT" which suggests the app is deployed somewhere, but there is no configuration file to reproduce that deployment.

Impact

  • Onboarding friction: contributors need to debug environment issues before they can run anything
  • Deployment is not reproducible — different machines produce different results
  • No isolation between the app's dependencies and the host system
  • No documented path for self-hosting

Suggested Dockerfile

FROM python:3.11-slim

WORKDIR /app

# Install dependencies first (layer caching)
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt

# Copy application code
COPY . .

# Streamlit config
ENV STREAMLIT_SERVER_PORT=8501
ENV STREAMLIT_SERVER_HEADLESS=true
ENV STREAMLIT_BROWSER_GATHER_USAGE_STATS=false

EXPOSE 8501

CMD ["streamlit", "run", "dashboard.py", "--server.address=0.0.0.0"]

Suggested docker-compose.yml

version: "3.9"
services:
  dashboard:
    build: .
    ports:
      - "8501:8501"
    volumes:
      - ./market_data:/app/market_data  # persist snapshots
    restart: unless-stopped

Additional Considerations

  • Add .dockerignore to exclude market_data/, .venv/, __pycache__/, .git/
  • Add HEALTHCHECK to the Dockerfile for production use
  • Document Docker usage in the README with a "Quick Start (Docker)" section
  • Consider a multi-stage build to keep the final image smaller

Acceptance Criteria

  • Dockerfile exists and builds successfully
  • docker-compose.yml exists with volume mount for market_data/
  • .dockerignore excludes non-essential files
  • README includes Docker quick-start instructions
  • Dashboard is accessible at http://localhost:8501 after docker-compose up

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions