mirror of
https://github.com/Dokploy/templates
synced 2025-06-26 18:16:07 +00:00
feat: Add numerous new blueprint templates for various applications
This commit is contained in:
87
blueprints/superset/docker-compose.yml
Normal file
87
blueprints/superset/docker-compose.yml
Normal file
@@ -0,0 +1,87 @@
|
||||
# This is an UNOFFICIAL production docker image build for Superset:
|
||||
# - https://github.com/amancevice/docker-superset
|
||||
|
||||
|
||||
# ## SETUP INSTRUCTIONS
|
||||
#
|
||||
# After deploying this image, you will need to run one of the two
|
||||
# commands below in a terminal within the superset container:
|
||||
# $ superset-demo # Initialise database + load demo charts/datasets
|
||||
# $ superset-init # Initialise database only
|
||||
#
|
||||
# You will be prompted to enter the credentials for the admin user.
|
||||
|
||||
|
||||
# ## NETWORK INSTRUCTIONS
|
||||
#
|
||||
# If you want to connect superset with other internal databases managed by
|
||||
# Dokploy (on dokploy-network) using internal hostnames, you will need to
|
||||
# uncomment the `networks` section, both for the superset container and
|
||||
# at the very bottom of this docker-compose template.
|
||||
#
|
||||
# Note that the `superset` service name/hostname will not be unique on the
|
||||
# global `dokploy-network`. If you plan to:
|
||||
#
|
||||
# 1. deploy a second instance of superset on dokploy-network, and
|
||||
# 2. have other containers on dokploy-network utilise the second instance's
|
||||
# Superset API (https://superset.apache.org/docs/api)
|
||||
#
|
||||
# Please change the service name of the second instance.
|
||||
|
||||
services:
|
||||
superset:
|
||||
image: amancevice/superset
|
||||
restart: always
|
||||
#networks:
|
||||
# - dokploy-network
|
||||
depends_on:
|
||||
- superset_postgres
|
||||
- superset_redis
|
||||
volumes:
|
||||
# This superset_config.py can be edited in Dokploy's UI Advanced -> Volume Mount
|
||||
- ../files/superset/superset_config.py:/etc/superset/superset_config.py
|
||||
environment:
|
||||
SECRET_KEY: ${SECRET_KEY}
|
||||
MAPBOX_API_KEY: ${MAPBOX_API_KEY}
|
||||
POSTGRES_USER: ${POSTGRES_USER}
|
||||
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
|
||||
POSTGRES_DB: ${POSTGRES_DB}
|
||||
REDIS_PASSWORD: ${REDIS_PASSWORD}
|
||||
# Ensure the hosts matches your service names below.
|
||||
POSTGRES_HOST: superset_postgres
|
||||
REDIS_HOST: superset_redis
|
||||
|
||||
superset_postgres:
|
||||
image: postgres
|
||||
restart: always
|
||||
environment:
|
||||
POSTGRES_USER: ${POSTGRES_USER}
|
||||
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
|
||||
POSTGRES_DB: ${POSTGRES_DB}
|
||||
volumes:
|
||||
- superset_postgres_data:/var/lib/postgresql/data
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", "pg_isready -U $${POSTGRES_USER} -d $${POSTGRES_DB}"]
|
||||
interval: 30s
|
||||
timeout: 10s
|
||||
retries: 3
|
||||
|
||||
superset_redis:
|
||||
image: redis
|
||||
restart: always
|
||||
volumes:
|
||||
- superset_redis_data:/data
|
||||
command: redis-server --requirepass ${REDIS_PASSWORD}
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", "pg_isready -U $${POSTGRES_USER} -d $${POSTGRES_DB}"]
|
||||
interval: 30s
|
||||
timeout: 10s
|
||||
retries: 3
|
||||
|
||||
#networks:
|
||||
# dokploy-network:
|
||||
# external: true
|
||||
|
||||
volumes:
|
||||
superset_postgres_data:
|
||||
superset_redis_data:
|
||||
77
blueprints/superset/index.ts
Normal file
77
blueprints/superset/index.ts
Normal file
@@ -0,0 +1,77 @@
|
||||
import {
|
||||
type DomainSchema,
|
||||
type Schema,
|
||||
type Template,
|
||||
generatePassword,
|
||||
generateRandomDomain,
|
||||
} from "../utils";
|
||||
|
||||
export function generate(schema: Schema): Template {
|
||||
const mapboxApiKey = "";
|
||||
const secretKey = generatePassword(30);
|
||||
const postgresDb = "superset";
|
||||
const postgresUser = "superset";
|
||||
const postgresPassword = generatePassword(30);
|
||||
const redisPassword = generatePassword(30);
|
||||
|
||||
const domains: DomainSchema[] = [
|
||||
{
|
||||
host: generateRandomDomain(schema),
|
||||
port: 8088,
|
||||
serviceName: "superset",
|
||||
},
|
||||
];
|
||||
|
||||
const envs = [
|
||||
`SECRET_KEY=${secretKey}`,
|
||||
`MAPBOX_API_KEY=${mapboxApiKey}`,
|
||||
`POSTGRES_DB=${postgresDb}`,
|
||||
`POSTGRES_USER=${postgresUser}`,
|
||||
`POSTGRES_PASSWORD=${postgresPassword}`,
|
||||
`REDIS_PASSWORD=${redisPassword}`,
|
||||
];
|
||||
|
||||
const mounts: Template["mounts"] = [
|
||||
{
|
||||
filePath: "./superset/superset_config.py",
|
||||
content: `
|
||||
"""
|
||||
For more configuration options, see:
|
||||
- https://superset.apache.org/docs/configuration/configuring-superset
|
||||
"""
|
||||
|
||||
import os
|
||||
|
||||
SECRET_KEY = os.getenv("SECRET_KEY")
|
||||
MAPBOX_API_KEY = os.getenv("MAPBOX_API_KEY", "")
|
||||
|
||||
CACHE_CONFIG = {
|
||||
"CACHE_TYPE": "RedisCache",
|
||||
"CACHE_DEFAULT_TIMEOUT": 300,
|
||||
"CACHE_KEY_PREFIX": "superset_",
|
||||
"CACHE_REDIS_HOST": "redis",
|
||||
"CACHE_REDIS_PORT": 6379,
|
||||
"CACHE_REDIS_DB": 1,
|
||||
"CACHE_REDIS_URL": f"redis://:{os.getenv('REDIS_PASSWORD')}@{os.getenv('REDIS_HOST')}:6379/1",
|
||||
}
|
||||
|
||||
FILTER_STATE_CACHE_CONFIG = {**CACHE_CONFIG, "CACHE_KEY_PREFIX": "superset_filter_"}
|
||||
EXPLORE_FORM_DATA_CACHE_CONFIG = {**CACHE_CONFIG, "CACHE_KEY_PREFIX": "superset_explore_form_"}
|
||||
|
||||
SQLALCHEMY_TRACK_MODIFICATIONS = True
|
||||
SQLALCHEMY_DATABASE_URI = f"postgresql+psycopg2://{os.getenv('POSTGRES_USER')}:{os.getenv('POSTGRES_PASSWORD')}@{os.getenv('POSTGRES_HOST')}:5432/{os.getenv('POSTGRES_DB')}"
|
||||
|
||||
# Uncomment if you want to load example data (using "superset load_examples") at the
|
||||
# same location as your metadata postgresql instance. Otherwise, the default sqlite
|
||||
# will be used, which will not persist in volume when restarting superset by default.
|
||||
#SQLALCHEMY_EXAMPLES_URI = SQLALCHEMY_DATABASE_URI
|
||||
`.trim(),
|
||||
},
|
||||
];
|
||||
|
||||
return {
|
||||
envs,
|
||||
domains,
|
||||
mounts,
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user