Skip to main content

Docker Deployment

Deploy Oneliac using Docker containers for consistent environments across development and production.

Prerequisites

  • Docker 20.10+
  • Docker Compose 2.0+
  • Git

Building Docker Images

Backend Service

cd Product-Oneliac
docker build -f Dockerfile -t oneliac-backend:latest .

Running with Docker Compose

docker-compose up -d

Container Configuration

The standard deployment includes:

  • FastAPI Application: Port 8000
  • PostgreSQL Database: Port 5432
  • Redis Cache: Port 6379
  • Solana Local Validator (optional): Port 8899

Environment Variables

Create a .env file in the project root:

DATABASE_URL=postgresql://user:password@db:5432/oneliac
SOLANA_RPC_URL=https://api.devnet.solana.com
REDIS_URL=redis://redis:6379
PYTHON_ENV=production

Volumes

  • /data/postgres: Database persistence
  • /data/ipfs: IPFS node data
  • /app/logs: Application logs

Health Checks

All containers include health check endpoints:

curl http://localhost:8000/health

Logs

View container logs:

docker-compose logs -f backend
docker-compose logs -f database