From 75c8d5d2036dd944200f3e9e9bce828a81485e38 Mon Sep 17 00:00:00 2001 From: Viktor Barzin Date: Sun, 22 Feb 2026 15:11:50 +0000 Subject: [PATCH] =?UTF-8?q?feat:=20docker=20compose=20infrastructure=20?= =?UTF-8?q?=E2=80=94=20postgres+timescaledb,=20redis,=20ollama?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env.example | 23 +++++++++++++++++++++++ .gitignore | 37 +++++++++++++++++++++++++++++++++++++ docker-compose.yml | 40 ++++++++++++++++++++++++++++++++++++++++ 3 files changed, 100 insertions(+) create mode 100644 .env.example create mode 100644 .gitignore create mode 100644 docker-compose.yml diff --git a/.env.example b/.env.example new file mode 100644 index 0000000..3b03cf3 --- /dev/null +++ b/.env.example @@ -0,0 +1,23 @@ +# PostgreSQL +POSTGRES_PASSWORD=trading + +# Trading Bot +TRADING_DATABASE_URL=postgresql+asyncpg://trading:trading@localhost:5432/trading +TRADING_REDIS_URL=redis://localhost:6379/0 +TRADING_LOG_LEVEL=INFO + +# Alpaca (paper trading) +ALPACA_API_KEY=your_api_key_here +ALPACA_SECRET_KEY=your_secret_key_here +ALPACA_BASE_URL=https://paper-api.alpaca.markets + +# JWT +JWT_SECRET_KEY=change-me-in-production + +# Reddit (for news fetcher) +REDDIT_CLIENT_ID=your_client_id +REDDIT_CLIENT_SECRET=your_client_secret +REDDIT_USER_AGENT=trading-bot/0.1 + +# Ollama +OLLAMA_HOST=http://localhost:11434 diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..9770cff --- /dev/null +++ b/.gitignore @@ -0,0 +1,37 @@ +# Python +__pycache__/ +*.py[cod] +*$py.class +*.so +*.egg-info/ +*.egg +.eggs/ +dist/ +build/ +.venv/ +venv/ +*.whl + +# Node +node_modules/ +dashboard/dist/ +dashboard/build/ + +# Secrets +.env +*.pem + +# IDE +.vscode/ +.idea/ +*.swp +*.swo +*~ + +# OS +.DS_Store +Thumbs.db + +# Data +*.db +*.sqlite3 diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..00aaef5 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,40 @@ +services: + postgres: + image: timescale/timescaledb:latest-pg16 + environment: + POSTGRES_USER: trading + POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-trading} + POSTGRES_DB: trading + ports: + - "5432:5432" + volumes: + - pgdata:/var/lib/postgresql/data + healthcheck: + test: ["CMD-SHELL", "pg_isready -U trading"] + interval: 5s + timeout: 5s + retries: 5 + + redis: + image: redis:7-alpine + ports: + - "6379:6379" + volumes: + - redisdata:/data + healthcheck: + test: ["CMD", "redis-cli", "ping"] + interval: 5s + timeout: 5s + retries: 5 + + ollama: + image: ollama/ollama:latest + ports: + - "11434:11434" + volumes: + - ollama_models:/root/.ollama + +volumes: + pgdata: + redisdata: + ollama_models: