Skip to content

Docker Installation

Deploy ElasticView using Docker for easy containerized deployment with consistent environments across different systems.

Prerequisites

  • Docker installed on your system
  • Docker Compose (optional, for easier management)

Quick Start

Using Docker Run

bash
# Pull the latest image
docker pull elasticview/elasticview:latest

# Run with default settings
docker run -d \
  --name elasticview \
  -p 8080:8080 \
  elasticview/elasticview:latest

Using Docker Compose

Create a docker-compose.yml file:

yaml
version: '3.8'

services:
  elasticview:
    image: elasticview/elasticview:latest
    container_name: elasticview
    ports:
      - "8080:8080"
    environment:
      - EV_DB_HOST=mysql
      - EV_DB_PORT=3306
      - EV_DB_NAME=elasticview
      - EV_DB_USER=root
      - EV_DB_PASSWORD=password
    depends_on:
      - mysql
    volumes:
      - elasticview_data:/app/data

  mysql:
    image: mysql:8.0
    container_name: elasticview_mysql
    environment:
      - MYSQL_ROOT_PASSWORD=password
      - MYSQL_DATABASE=elasticview
    volumes:
      - mysql_data:/var/lib/mysql
    ports:
      - "3306:3306"

volumes:
  elasticview_data:
  mysql_data:

Start the services:

bash
docker-compose up -d

Configuration

Environment Variables

VariableDescriptionDefault
EV_PORTServer port8080
EV_DB_HOSTDatabase hostlocalhost
EV_DB_PORTDatabase port3306
EV_DB_NAMEDatabase nameelasticview
EV_DB_USERDatabase userroot
EV_DB_PASSWORDDatabase password-

Volume Mounts

bash
docker run -d \
  --name elasticview \
  -p 8080:8080 \
  -v /host/config:/app/config \
  -v /host/data:/app/data \
  -v /host/logs:/app/logs \
  elasticview/elasticview:latest

Production Deployment

With External Database

yaml
version: '3.8'

services:
  elasticview:
    image: elasticview/elasticview:latest
    container_name: elasticview
    ports:
      - "8080:8080"
    environment:
      - EV_DB_HOST=your-db-host
      - EV_DB_PORT=3306
      - EV_DB_NAME=elasticview
      - EV_DB_USER=elasticview_user
      - EV_DB_PASSWORD=secure_password
    volumes:
      - ./config:/app/config
      - ./data:/app/data
      - ./logs:/app/logs
    restart: unless-stopped

With SSL/HTTPS

yaml
version: '3.8'

services:
  elasticview:
    image: elasticview/elasticview:latest
    container_name: elasticview
    environment:
      - EV_SSL_ENABLED=true
      - EV_SSL_CERT=/app/ssl/cert.pem
      - EV_SSL_KEY=/app/ssl/key.pem
    volumes:
      - ./ssl:/app/ssl
      - ./config:/app/config
    ports:
      - "443:443"
    restart: unless-stopped

Monitoring

Health Check

yaml
healthcheck:
  test: ["CMD", "curl", "-f", "http://localhost:8080/health"]
  interval: 30s
  timeout: 10s
  retries: 3
  start_period: 40s

Logging

yaml
logging:
  driver: "json-file"
  options:
    max-size: "10m"
    max-file: "3"

Troubleshooting

Container Won't Start

Check container logs:

bash
docker logs elasticview

Database Connection Issues

Verify database connectivity:

bash
docker exec -it elasticview ping mysql

Port Conflicts

Change the host port:

bash
docker run -d --name elasticview -p 8081:8080 elasticview/elasticview:latest

Updating

Pull Latest Image

bash
docker pull elasticview/elasticview:latest
docker stop elasticview
docker rm elasticview
docker run -d --name elasticview -p 8080:8080 elasticview/elasticview:latest

Using Docker Compose

bash
docker-compose pull
docker-compose up -d

Next Steps