first commit
Some checks failed
Vulhub Format Check and Lint / format-check (push) Has been cancelled
Vulhub Format Check and Lint / markdown-check (push) Has been cancelled
Vulhub Docker Image CI / longtime-images-test (push) Has been cancelled
Vulhub Docker Image CI / images-test (push) Has been cancelled
Some checks failed
Vulhub Format Check and Lint / format-check (push) Has been cancelled
Vulhub Format Check and Lint / markdown-check (push) Has been cancelled
Vulhub Docker Image CI / longtime-images-test (push) Has been cancelled
Vulhub Docker Image CI / images-test (push) Has been cancelled
This commit is contained in:
10
base/superset/2.0.1/Dockerfile
Normal file
10
base/superset/2.0.1/Dockerfile
Normal file
@@ -0,0 +1,10 @@
|
||||
FROM apache/superset:2.0.1
|
||||
|
||||
LABEL maintainer="phithon <root@leavesongs.com>"
|
||||
|
||||
USER root
|
||||
COPY ./entrypoint.sh /entrypoint.sh
|
||||
COPY ./run-server.sh /run-server.sh
|
||||
|
||||
ENTRYPOINT ["/entrypoint.sh"]
|
||||
CMD ["/run-server.sh", "app-gunicorn"]
|
36
base/superset/2.0.1/entrypoint.sh
Normal file
36
base/superset/2.0.1/entrypoint.sh
Normal file
@@ -0,0 +1,36 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -eo pipefail
|
||||
|
||||
load_examples_async() {
|
||||
echo "Waiting for Superset to be ready..."
|
||||
until curl -s --max-time 1 http://localhost:8088/health > /dev/null; do
|
||||
sleep 1
|
||||
echo -n "."
|
||||
done
|
||||
echo "Loading examples..."
|
||||
superset load_examples
|
||||
}
|
||||
|
||||
if [[ ! -e /app/superset_home/superset.db ]]; then
|
||||
echo "Database not found, initializing..."
|
||||
superset db upgrade
|
||||
|
||||
echo "Creating admin user..."
|
||||
superset fab create-admin \
|
||||
--username ${SUPERSET_ADMIN_USERNAME:-admin} \
|
||||
--firstname Superset \
|
||||
--lastname Admin \
|
||||
--email ${SUPERSET_ADMIN_EMAIL:-admin@superset.com} \
|
||||
--password ${SUPERSET_ADMIN_PASSWORD:-vulhub}
|
||||
|
||||
echo "Initializing Superset..."
|
||||
superset init
|
||||
fi
|
||||
|
||||
if [[ "${SUPERSET_LOAD_EXAMPLES}" == "yes" ]]; then
|
||||
# Start loading examples in background
|
||||
load_examples_async &
|
||||
fi
|
||||
|
||||
exec "$@"
|
48
base/superset/2.0.1/run-server.sh
Normal file
48
base/superset/2.0.1/run-server.sh
Normal file
@@ -0,0 +1,48 @@
|
||||
#!/usr/bin/env bash
|
||||
#
|
||||
# Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
# contributor license agreements. See the NOTICE file distributed with
|
||||
# this work for additional information regarding copyright ownership.
|
||||
# The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
# (the "License"); you may not use this file except in compliance with
|
||||
# the License. You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
#
|
||||
|
||||
set -eo pipefail
|
||||
|
||||
HYPHEN_SYMBOL='-'
|
||||
|
||||
if [[ "${1}" == "worker" ]]; then
|
||||
echo "Starting Celery worker..."
|
||||
celery --app=superset.tasks.celery_app:app worker -Ofair -l INFO
|
||||
elif [[ "${1}" == "beat" ]]; then
|
||||
echo "Starting Celery beat..."
|
||||
celery --app=superset.tasks.celery_app:app beat --pidfile /tmp/celerybeat.pid -l INFO -s "${SUPERSET_HOME}"/celerybeat-schedule
|
||||
elif [[ "${1}" == "app" ]]; then
|
||||
echo "Starting web app..."
|
||||
flask run -p 8088 --with-threads --reload --debugger --host=0.0.0.0
|
||||
elif [[ "${1}" == "app-gunicorn" ]]; then
|
||||
echo "Starting web app..."
|
||||
gunicorn \
|
||||
--bind "${SUPERSET_BIND_ADDRESS:-0.0.0.0}:${SUPERSET_PORT:-8088}" \
|
||||
--access-logfile "${ACCESS_LOG_FILE:-$HYPHEN_SYMBOL}" \
|
||||
--error-logfile "${ERROR_LOG_FILE:-$HYPHEN_SYMBOL}" \
|
||||
--workers ${SERVER_WORKER_AMOUNT:-1} \
|
||||
--worker-class ${SERVER_WORKER_CLASS:-gthread} \
|
||||
--threads ${SERVER_THREADS_AMOUNT:-20} \
|
||||
--timeout ${GUNICORN_TIMEOUT:-60} \
|
||||
--keep-alive ${GUNICORN_KEEPALIVE:-2} \
|
||||
--max-requests ${WORKER_MAX_REQUESTS:-0} \
|
||||
--max-requests-jitter ${WORKER_MAX_REQUESTS_JITTER:-0} \
|
||||
--limit-request-line ${SERVER_LIMIT_REQUEST_LINE:-0} \
|
||||
--limit-request-field_size ${SERVER_LIMIT_REQUEST_FIELD_SIZE:-0} \
|
||||
"${FLASK_APP}"
|
||||
fi
|
Reference in New Issue
Block a user