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:latestUsing 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 -dConfiguration
Environment Variables
| Variable | Description | Default |
|---|---|---|
EV_PORT | Server port | 8080 |
EV_DB_HOST | Database host | localhost |
EV_DB_PORT | Database port | 3306 |
EV_DB_NAME | Database name | elasticview |
EV_DB_USER | Database user | root |
EV_DB_PASSWORD | Database 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:latestProduction 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-stoppedWith 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-stoppedMonitoring
Health Check
yaml
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8080/health"]
interval: 30s
timeout: 10s
retries: 3
start_period: 40sLogging
yaml
logging:
driver: "json-file"
options:
max-size: "10m"
max-file: "3"Troubleshooting
Container Won't Start
Check container logs:
bash
docker logs elasticviewDatabase Connection Issues
Verify database connectivity:
bash
docker exec -it elasticview ping mysqlPort Conflicts
Change the host port:
bash
docker run -d --name elasticview -p 8081:8080 elasticview/elasticview:latestUpdating
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:latestUsing Docker Compose
bash
docker-compose pull
docker-compose up -d