mirror of
https://github.com/altstackHQ/altstack-data.git
synced 2026-04-23 17:25:14 +02:00
🤖 Sentinel: Synchronization from aa-humaaan/thealtstack
This commit is contained in:
45
docker-deploy/superset/Dockerfile
Normal file
45
docker-deploy/superset/Dockerfile
Normal file
@@ -0,0 +1,45 @@
|
||||
# Dockerfile for Apache Superset
|
||||
# Stage 1: Build Frontend (Optional if using pre-built assets, but good for custom builds)
|
||||
FROM node:20-alpine AS frontend-builder
|
||||
WORKDIR /app/superset-frontend
|
||||
COPY superset-frontend/package.json superset-frontend/package-lock.json ./
|
||||
RUN npm ci
|
||||
COPY superset-frontend/ .
|
||||
RUN npm run build
|
||||
|
||||
# Stage 2: Final Image
|
||||
FROM python:3.11-slim-bookworm
|
||||
|
||||
# Create non-root user
|
||||
RUN groupadd -r superset && useradd -r -m -g superset superset
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
# Install system dependencies
|
||||
RUN apt-get update && apt-get install -y \
|
||||
build-essential \
|
||||
curl \
|
||||
libpq-dev \
|
||||
libssl-dev \
|
||||
libffi-dev \
|
||||
libsasl2-dev \
|
||||
libldap2-dev \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# Install Superset
|
||||
RUN pip install --no-cache-dir apache-superset flask-appbuilder
|
||||
|
||||
# Copy built frontend assets (if built in Stage 1)
|
||||
# COPY --from=frontend-builder /app/superset/static/assets /app/superset/static/assets
|
||||
|
||||
# Set permissions
|
||||
RUN chown -R superset:superset /app
|
||||
|
||||
USER superset
|
||||
|
||||
ENV SUPERSET_CONFIG_PATH=/app/superset_config.py
|
||||
ENV FLASK_APP=superset
|
||||
|
||||
EXPOSE 8088
|
||||
|
||||
CMD ["superset", "run", "-p", "8088", "--with-threads", "--reload", "--debugger"]
|
||||
66
docker-deploy/superset/docker-compose.yml
Normal file
66
docker-deploy/superset/docker-compose.yml
Normal file
@@ -0,0 +1,66 @@
|
||||
# ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
||||
# 🚀 BUILT & MAINTAINED BY THE ALTSTACK
|
||||
# 🌍 https://thealtstack.com
|
||||
# 💡 Open-source deployment templates for modern self-hosting.
|
||||
# ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
||||
|
||||
|
||||
# Docker Compose for Apache Superset
|
||||
|
||||
services:
|
||||
superset:
|
||||
image: apache/superset:latest
|
||||
container_name: superset
|
||||
ports:
|
||||
- "8088:8088"
|
||||
environment:
|
||||
- DATABASE_URL=postgresql://superset:superset@db:5432/superset
|
||||
- REDIS_URL=redis://redis:6379
|
||||
depends_on:
|
||||
db:
|
||||
condition: service_healthy
|
||||
redis:
|
||||
condition: service_healthy
|
||||
networks:
|
||||
- superset_net
|
||||
healthcheck:
|
||||
test: [ "CMD", "curl", "-f", "http://localhost:8088/health" ]
|
||||
interval: 30s
|
||||
timeout: 10s
|
||||
retries: 3
|
||||
|
||||
db:
|
||||
image: postgres:15-alpine
|
||||
container_name: superset-db
|
||||
environment:
|
||||
POSTGRES_USER: superset
|
||||
POSTGRES_PASSWORD: superset
|
||||
POSTGRES_DB: superset
|
||||
volumes:
|
||||
- superset_db_data:/var/lib/postgresql/data
|
||||
networks:
|
||||
- superset_net
|
||||
healthcheck:
|
||||
test: [ "CMD-SHELL", "pg_isready -U superset" ]
|
||||
interval: 5s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
|
||||
redis:
|
||||
image: redis:7-alpine
|
||||
container_name: superset-redis
|
||||
networks:
|
||||
- superset_net
|
||||
healthcheck:
|
||||
test: [ "CMD", "redis-cli", "ping" ]
|
||||
interval: 5s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
|
||||
networks:
|
||||
superset_net:
|
||||
driver: bridge
|
||||
|
||||
volumes:
|
||||
superset_db_data:
|
||||
name: superset_db_data
|
||||
103
docker-deploy/superset/install.sh
Executable file
103
docker-deploy/superset/install.sh
Executable file
@@ -0,0 +1,103 @@
|
||||
#!/bin/bash
|
||||
# 🚀 Auto-generated by The AltStack
|
||||
# https://thealtstack.com
|
||||
|
||||
echo "🔵 Starting AltStack Deployment..."
|
||||
|
||||
# 1. Check/Install Docker
|
||||
if ! command -v docker &> /dev/null; then
|
||||
echo "📦 Docker not found. Installing..."
|
||||
curl -fsSL https://get.docker.com -o get-docker.sh
|
||||
sh get-docker.sh
|
||||
rm get-docker.sh
|
||||
echo "✅ Docker installed."
|
||||
else
|
||||
echo "✅ Docker is already installed."
|
||||
fi
|
||||
|
||||
# 2. Setup Directory
|
||||
APP_DIR="superset-deploy"
|
||||
mkdir -p $APP_DIR
|
||||
cd $APP_DIR
|
||||
echo "📂 Created directory: $APP_DIR"
|
||||
|
||||
# 3. Create docker-compose.yml
|
||||
echo "📄 Writing configuration..."
|
||||
cat << 'INNER_EOF' > docker-compose.yml
|
||||
# -------------------------------------------------------------------------
|
||||
# 🚀 Created and distributed by The AltStack
|
||||
# 🌍 https://thealtstack.com
|
||||
# -------------------------------------------------------------------------
|
||||
|
||||
# Docker Compose for Apache Superset
|
||||
version: '3.8'
|
||||
|
||||
services:
|
||||
superset:
|
||||
build:
|
||||
context: .
|
||||
dockerfile: Dockerfile
|
||||
container_name: superset
|
||||
ports:
|
||||
- "8088:8088"
|
||||
environment:
|
||||
- DATABASE_URL=postgresql://superset:superset@db:5432/superset
|
||||
- REDIS_URL=redis://redis:6379
|
||||
depends_on:
|
||||
db:
|
||||
condition: service_healthy
|
||||
redis:
|
||||
condition: service_healthy
|
||||
networks:
|
||||
- superset_net
|
||||
healthcheck:
|
||||
test: [ "CMD", "curl", "-f", "http://localhost:8088/health" ]
|
||||
interval: 30s
|
||||
timeout: 10s
|
||||
retries: 3
|
||||
|
||||
db:
|
||||
image: postgres:15-alpine
|
||||
container_name: superset-db
|
||||
environment:
|
||||
POSTGRES_USER: superset
|
||||
POSTGRES_PASSWORD: superset
|
||||
POSTGRES_DB: superset
|
||||
volumes:
|
||||
- superset_db_data:/var/lib/postgresql/data
|
||||
networks:
|
||||
- superset_net
|
||||
healthcheck:
|
||||
test: [ "CMD-SHELL", "pg_isready -U superset" ]
|
||||
interval: 5s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
|
||||
redis:
|
||||
image: redis:7-alpine
|
||||
container_name: superset-redis
|
||||
networks:
|
||||
- superset_net
|
||||
healthcheck:
|
||||
test: [ "CMD", "redis-cli", "ping" ]
|
||||
interval: 5s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
|
||||
networks:
|
||||
superset_net:
|
||||
driver: bridge
|
||||
|
||||
volumes:
|
||||
superset_db_data:
|
||||
name: superset_db_data
|
||||
|
||||
INNER_EOF
|
||||
|
||||
# 4. Start Services
|
||||
echo "🚀 Starting services..."
|
||||
docker compose up -d
|
||||
|
||||
echo ""
|
||||
echo "✅ Deployment Complete!"
|
||||
echo "👉 Your superset stack is running."
|
||||
Reference in New Issue
Block a user