Git Product home page Git Product logo

Comments (5)

dosubot avatar dosubot commented on September 13, 2024 2

Hey @kainchow, I'm here to help you out with this Superset issue! I'm a bot that can assist with bug solving, answer questions, and help you become a contributor. Let's tackle this bug together! 🤖

To ensure that Superset starts in the production environment using Docker Compose, you should use the docker-compose-non-dev.yml file provided. Here are the steps to follow:

  1. Create a Docker environment file: Make sure you have a docker/.env file with your own unique random secure passwords and SECRET_KEY.

  2. Run the Docker Compose command: Use the following command to start Superset in the production environment:

    docker-compose -f docker-compose-non-dev.yml up -d

Ensure that the docker/.env file is correctly set up before running the command. The docker-compose-non-dev.yml file is configured for a non-development environment and should not default to development if the environment variables are correctly set.

Here is a snippet of the docker-compose-non-dev.yml file for reference:

version: "4.0"
services:
  redis:
    image: redis:7
    container_name: superset_cache
    restart: unless-stopped
    volumes:
      - redis:/data
  db:
    env_file:
      - path: docker/.env # default
        required: true
      - path: docker/.env-local # optional override
        required: false
    image: postgres:15
    container_name: superset_db
    restart: unless-stopped
    volumes:
      - db_home:/var/lib/postgresql/data
      - ./docker/docker-entrypoint-initdb.d:/docker-entrypoint-initdb.d

  superset:
    env_file:
      - path: docker/.env # default
        required: true
      - path: docker/.env-local # optional override
        required: false
    build:
      <<: *common-build
    container_name: superset_app
    command: ["/app/docker/docker-bootstrap.sh", "app-gunicorn"]
    user: "root"
    restart: unless-stopped
    ports:
      - 8088:8088
    depends_on: *superset-depends-on
    volumes: *superset-volumes

  superset-init:
    container_name: superset_init
    build:
      <<: *common-build
    command: ["/app/docker/docker-init.sh"]
    env_file:
      - path: docker/.env # default
        required: true
      - path: docker/.env-local # optional override
        required: false
    depends_on: *superset-depends-on
    user: "root"
    volumes: *superset-volumes
    healthcheck:
      disable: true

  superset-worker:
    build:
      <<: *common-build
    container_name: superset_worker
    command: ["/app/docker/docker-bootstrap.sh", "worker"]
    env_file:
      - path: docker/.env # default
        required: true
      - path: docker/.env-local # optional override
        required: false
    restart: unless-stopped
    depends_on: *superset-depends-on
    user: "root"
    volumes: *superset-volumes
    healthcheck:
      test:
        [
          "CMD-SHELL",
          "celery -A superset.tasks.celery_app:app inspect ping -d celery@$$HOSTNAME",
        ]
  superset-worker-beat:
    build:
      <<: *common-build
    container_name: superset_worker_beat
    command: ["/app/docker/docker-bootstrap.sh", "beat"]
    env_file:
      - path: docker/.env # default
        required: true
      - path: docker/.env-local # optional override
        required: false
    restart: unless-stopped
    depends_on: *superset-depends-on
    user: "root"
    volumes: *superset-volumes
    healthcheck:
      disable: true

volumes:
  superset_home:
    external: false
  db_home:
    external: false
  redis:
    external: false

For more advanced configurations, you can refer to the docker/README.md file in the Superset repository [1][2].

Details

About Dosu
This response is meant to be useful and save you time. It is not meant to be a precise solution, but rather a starting point for your own research.

Help me be more useful! Please leave a 👍 if this is helpful and 👎 if it is irrelevant.

To continue the conversation, mention @dosu.

from superset.

kainchow avatar kainchow commented on September 13, 2024 1

I created a new superset_config_docker.py file in the docker/pythonpath_dev directory and added SECRET_KEY, but it still enters the development environment when executing docker compose -f docker-compose-non-dev up, here is superset_config_docker.py:

import os
from superset.utils import core as utils

FEATURE_FLAGS = {
    "ENABLE_TEMPLATE_PROCESSING": True,
}

ENABLE_PROXY_FIX = True
SECRET_KEY = "jwoxth9akQkkzTnen2P4BRQgTRoT8fsv8f3XTKalqE2Ur2ZHQ1NeZxdVxU70Uake"

BABEL_DEFAULT_LOCALE='zh'
BABEL_DEFAULT_FOLDER = 'superset/translations'
LANGUAGES = {
    'zh': {'flag': 'cn', 'name': 'įŽ€äŊ“中文'},
    'en': {'flag': 'us', 'name': 'English'}
}

WTF_CSRF_ENABLED = False
TALISMAN_ENABLED = utils.cast_to_boolean(os.environ.get("TALISMAN_ENABLED", False))

# Maximum number of rows returned for any analytical database query
SQL_MAX_ROW = 10000000
# default row limit when requesting chart data
# ROW_LIMIT = 10000000
FAVICONS = [{"href": "/static/assets/images/superset-mz-black.png"}]

from superset.

kainchow avatar kainchow commented on September 13, 2024

By the way, BABEL_DEFAULT_LOCALE and LANGUAGES are effective.
image

from superset.

kainchow avatar kainchow commented on September 13, 2024

When I use tag=3.1.3, superset works fine for production, but the latest version, 4.0.1rc, doesn't work!
image

from superset.

kainchow avatar kainchow commented on September 13, 2024

tag=4.0.1 worked for me, but master branch error

from superset.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤ī¸ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.