sdadfadas
/
docker-compose.yml
238 строк · 7.3 Кб
1#
2# Licensed to the Apache Software Foundation (ASF) under one or more
3# contributor license agreements. See the NOTICE file distributed with
4# this work for additional information regarding copyright ownership.
5# The ASF licenses this file to You under the Apache License, Version 2.0
6# (the "License"); you may not use this file except in compliance with
7# the License. You may obtain a copy of the License at
8#
9# http://www.apache.org/licenses/LICENSE-2.0
10#
11# Unless required by applicable law or agreed to in writing, software
12# distributed under the License is distributed on an "AS IS" BASIS,
13# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14# See the License for the specific language governing permissions and
15# limitations under the License.
16#
17
18# -----------------------------------------------------------------------
19# We don't support docker-compose for production environments.
20# If you choose to use this type of deployment make sure to
21# create you own docker environment file (docker/.env) with your own
22# unique random secure passwords and SECRET_KEY.
23# -----------------------------------------------------------------------
24x-superset-user: &superset-user root25x-superset-depends-on: &superset-depends-on26- db27- redis28x-superset-volumes: &superset-volumes29# /app/pythonpath_docker will be appended to the PYTHONPATH in the final container30- ./docker:/app/docker31- ./superset:/app/superset32- ./superset-frontend:/app/superset-frontend33- superset_home:/app/superset_home34- ./tests:/app/tests35
36x-common-build: &common-build37context: .38target: dev39cache_from:40- apache/superset-cache:3.10-slim-bookworm41
42services:43nginx:44image: nginx:latest45container_name: superset_nginx46restart: unless-stopped47ports:48- "80:80"49extra_hosts:50- "host.docker.internal:host-gateway"51volumes:52- ./docker/nginx/nginx.conf:/etc/nginx/nginx.conf:ro53redis:54image: redis:755container_name: superset_cache56restart: unless-stopped57ports:58- "127.0.0.1:6379:6379"59volumes:60- redis:/data61
62db:63env_file:64- path: docker/.env # default65required: true66- path: docker/.env-local # optional override67required: false68image: postgres:1569container_name: superset_db70restart: unless-stopped71ports:72- "127.0.0.1:5432:5432"73volumes:74- db_home:/var/lib/postgresql/data75- ./docker/docker-entrypoint-initdb.d:/docker-entrypoint-initdb.d76
77superset:78env_file:79- path: docker/.env # default80required: true81- path: docker/.env-local # optional override82required: false83build:84<<: *common-build85container_name: superset_app86command: ["/app/docker/docker-bootstrap.sh", "app"]87restart: unless-stopped88ports:89- 8088:808890extra_hosts:91- "host.docker.internal:host-gateway"92user: *superset-user93depends_on: *superset-depends-on94volumes: *superset-volumes95environment:96CYPRESS_CONFIG: "${CYPRESS_CONFIG:-}"97
98superset-websocket:99container_name: superset_websocket100build: ./superset-websocket101ports:102- 8080:8080103extra_hosts:104- "host.docker.internal:host-gateway"105depends_on:106- redis107# Mount everything in superset-websocket into container and108# then exclude node_modules and dist with bogus volume mount.109# This is necessary because host and container need to have110# their own, separate versions of these files. .dockerignore111# does not seem to work when starting the service through112# docker compose.113#114# For example, node_modules may contain libs with native bindings.115# Those bindings need to be compiled for each OS and the container116# OS is not necessarily the same as host OS.117volumes:118- ./superset-websocket:/home/superset-websocket119- /home/superset-websocket/node_modules120- /home/superset-websocket/dist121
122# Mounting a config file that contains a dummy secret required to boot up.123# do not use this docker-compose in production124- ./docker/superset-websocket/config.json:/home/superset-websocket/config.json125environment:126- PORT=8080127- REDIS_HOST=redis128- REDIS_PORT=6379129- REDIS_SSL=false130
131superset-init:132build:133<<: *common-build134container_name: superset_init135command: ["/app/docker/docker-init.sh"]136env_file:137- path: docker/.env # default138required: true139- path: docker/.env-local # optional override140required: false141depends_on: *superset-depends-on142user: *superset-user143volumes: *superset-volumes144environment:145CYPRESS_CONFIG: "${CYPRESS_CONFIG:-}"146healthcheck:147disable: true148
149superset-node:150image: node:18151environment:152# set this to false if you have perf issues running the npm i; npm run dev in-docker153# if you do so, you have to run this manually on the host, which should perform better!154SCARF_ANALYTICS: "${SCARF_ANALYTICS:-}"155container_name: superset_node156command: ["/app/docker/docker-frontend.sh"]157env_file:158- path: docker/.env # default159required: true160- path: docker/.env-local # optional override161required: false162depends_on: *superset-depends-on163volumes: *superset-volumes164
165superset-worker:166build:167<<: *common-build168container_name: superset_worker169command: ["/app/docker/docker-bootstrap.sh", "worker"]170env_file:171- path: docker/.env # default172required: true173- path: docker/.env-local # optional override174required: false175environment:176CELERYD_CONCURRENCY: 2177restart: unless-stopped178depends_on: *superset-depends-on179user: *superset-user180volumes: *superset-volumes181extra_hosts:182- "host.docker.internal:host-gateway"183healthcheck:184test: ["CMD-SHELL", "celery -A superset.tasks.celery_app:app inspect ping -d celery@$$HOSTNAME"]185# Bump memory limit if processing selenium / thumbnails on superset-worker186# mem_limit: 2038m187# mem_reservation: 128M188
189superset-worker-beat:190build:191<<: *common-build192container_name: superset_worker_beat193command: ["/app/docker/docker-bootstrap.sh", "beat"]194env_file:195- path: docker/.env # default196required: true197- path: docker/.env-local # optional override198required: false199restart: unless-stopped200depends_on: *superset-depends-on201user: *superset-user202volumes: *superset-volumes203healthcheck:204disable: true205
206superset-tests-worker:207build:208<<: *common-build209container_name: superset_tests_worker210command: ["/app/docker/docker-bootstrap.sh", "worker"]211env_file:212- path: docker/.env # default213required: true214- path: docker/.env-local # optional override215required: false216profiles:217- optional218environment:219DATABASE_HOST: localhost220DATABASE_DB: test221REDIS_CELERY_DB: 2222REDIS_RESULTS_DB: 3223REDIS_HOST: localhost224CELERYD_CONCURRENCY: 8225network_mode: host226depends_on: *superset-depends-on227user: *superset-user228volumes: *superset-volumes229healthcheck:230test: ["CMD-SHELL", "celery inspect ping -A superset.tasks.celery_app:app -d celery@$$HOSTNAME"]231
232volumes:233superset_home:234external: false235db_home:236external: false237redis:238external: false239