17. docker deployment
This commit is contained in:
87
COBY/docker-compose.dev.yml
Normal file
87
COBY/docker-compose.dev.yml
Normal file
@ -0,0 +1,87 @@
|
||||
# Docker Compose configuration for development environment
|
||||
version: '3.8'
|
||||
|
||||
services:
|
||||
# Override main app for development
|
||||
coby-app:
|
||||
build:
|
||||
context: .
|
||||
dockerfile: Dockerfile
|
||||
target: development
|
||||
environment:
|
||||
# Development overrides
|
||||
ENVIRONMENT: development
|
||||
DEBUG: true
|
||||
LOG_LEVEL: DEBUG
|
||||
|
||||
# Database configuration
|
||||
DB_HOST: timescaledb
|
||||
DB_PORT: 5432
|
||||
DB_NAME: ${DB_NAME:-market_data_dev}
|
||||
DB_USER: ${DB_USER:-market_user}
|
||||
DB_PASSWORD: ${DB_PASSWORD:-dev_password}
|
||||
|
||||
# Redis configuration
|
||||
REDIS_HOST: redis
|
||||
REDIS_PORT: 6379
|
||||
REDIS_PASSWORD: ${REDIS_PASSWORD:-dev_redis}
|
||||
|
||||
# Development settings
|
||||
PYTHONPATH: /app
|
||||
FLASK_ENV: development
|
||||
FLASK_DEBUG: 1
|
||||
volumes:
|
||||
# Mount source code for live reloading
|
||||
- .:/app
|
||||
- ./logs:/app/logs
|
||||
- ./data:/app/data
|
||||
ports:
|
||||
- "8080:8080"
|
||||
- "8081:8081"
|
||||
- "5678:5678" # Debug port
|
||||
command: ["python", "-m", "COBY.main", "--debug", "--reload"]
|
||||
|
||||
# Development database with different settings
|
||||
timescaledb:
|
||||
environment:
|
||||
POSTGRES_DB: ${DB_NAME:-market_data_dev}
|
||||
POSTGRES_USER: ${DB_USER:-market_user}
|
||||
POSTGRES_PASSWORD: ${DB_PASSWORD:-dev_password}
|
||||
POSTGRES_HOST_AUTH_METHOD: trust # Less secure for dev
|
||||
ports:
|
||||
- "5433:5432" # Different port to avoid conflicts
|
||||
|
||||
# Development Redis
|
||||
redis:
|
||||
ports:
|
||||
- "6380:6379" # Different port to avoid conflicts
|
||||
command: redis-server --requirepass ${REDIS_PASSWORD:-dev_redis}
|
||||
|
||||
# Hot-reload web dashboard
|
||||
coby-dashboard-dev:
|
||||
image: nginx:alpine
|
||||
container_name: coby-dashboard-dev
|
||||
ports:
|
||||
- "3000:80"
|
||||
volumes:
|
||||
- ./web/static:/usr/share/nginx/html
|
||||
- ./docker/nginx-dev.conf:/etc/nginx/nginx.conf:ro
|
||||
networks:
|
||||
- coby-network
|
||||
depends_on:
|
||||
- coby-app
|
||||
|
||||
# Development tools container
|
||||
dev-tools:
|
||||
build:
|
||||
context: .
|
||||
dockerfile: Dockerfile
|
||||
target: development
|
||||
container_name: coby-dev-tools
|
||||
volumes:
|
||||
- .:/app
|
||||
networks:
|
||||
- coby-network
|
||||
command: ["tail", "-f", "/dev/null"] # Keep container running
|
||||
profiles:
|
||||
- tools
|
Reference in New Issue
Block a user