From 72da65721a2f04ffb6bf997bf51dbac19776e37f Mon Sep 17 00:00:00 2001 From: Matt Bruce Date: Mon, 23 Feb 2026 21:33:39 -0600 Subject: [PATCH] Signed-off-by: Matt Bruce --- Dockerfile | 17 +++++++++++++++++ docker-compose.yml | 17 +++++++++-------- 2 files changed, 26 insertions(+), 8 deletions(-) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..1fa6021 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,17 @@ +FROM python:3.11-slim + +ENV PYTHONDONTWRITEBYTECODE=1 \ + PYTHONUNBUFFERED=1 \ + PIP_NO_CACHE_DIR=1 \ + STREAMLIT_BROWSER_GATHER_USAGE_STATS=false + +WORKDIR /app + +COPY requirements.txt /app/requirements.txt +RUN pip install -r /app/requirements.txt + +COPY . /app + +EXPOSE 8502 + +CMD ["streamlit", "run", "app.py", "--server.address=0.0.0.0", "--server.port=8502", "--server.headless=true"] diff --git a/docker-compose.yml b/docker-compose.yml index b35cf23..e3da4ea 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,8 +1,10 @@ services: maneshtrader: - image: python:3.11-slim - container_name: maneshtrader2 - working_dir: /app + image: maneshtrader:latest + pull_policy: build + build: + context: . + dockerfile: Dockerfile restart: unless-stopped ports: - "${APP_PORT:-8502}:8502" @@ -12,14 +14,13 @@ services: PIP_NO_CACHE_DIR: "1" STREAMLIT_BROWSER_GATHER_USAGE_STATS: "false" volumes: - - ./:/app - - ./data:/root/.web_local_shell - command: > - sh -c "pip install -r requirements.txt && - streamlit run app.py --server.address=0.0.0.0 --server.port=8502 --server.headless=true" + - maneshtrader_data:/root/.web_local_shell healthcheck: test: ["CMD-SHELL", "python -c \"import urllib.request; urllib.request.urlopen('http://127.0.0.1:8502/_stcore/health', timeout=3)\" || exit 1"] interval: 30s timeout: 5s retries: 5 start_period: 45s + +volumes: + maneshtrader_data: