sdadfadas

Форк
0
/
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
# -----------------------------------------------------------------------
24
x-superset-user: &superset-user root
25
x-superset-depends-on: &superset-depends-on
26
  - db
27
  - redis
28
x-superset-volumes: &superset-volumes
29
  # /app/pythonpath_docker will be appended to the PYTHONPATH in the final container
30
  - ./docker:/app/docker
31
  - ./superset:/app/superset
32
  - ./superset-frontend:/app/superset-frontend
33
  - superset_home:/app/superset_home
34
  - ./tests:/app/tests
35

36
x-common-build: &common-build
37
  context: .
38
  target: dev
39
  cache_from:
40
    - apache/superset-cache:3.10-slim-bookworm
41

42
services:
43
  nginx:
44
    image: nginx:latest
45
    container_name: superset_nginx
46
    restart: unless-stopped
47
    ports:
48
      - "80:80"
49
    extra_hosts:
50
      - "host.docker.internal:host-gateway"
51
    volumes:
52
      - ./docker/nginx/nginx.conf:/etc/nginx/nginx.conf:ro
53
  redis:
54
    image: redis:7
55
    container_name: superset_cache
56
    restart: unless-stopped
57
    ports:
58
      - "127.0.0.1:6379:6379"
59
    volumes:
60
      - redis:/data
61

62
  db:
63
    env_file:
64
      - path: docker/.env # default
65
        required: true
66
      - path: docker/.env-local # optional override
67
        required: false
68
    image: postgres:15
69
    container_name: superset_db
70
    restart: unless-stopped
71
    ports:
72
      - "127.0.0.1:5432:5432"
73
    volumes:
74
      - db_home:/var/lib/postgresql/data
75
      - ./docker/docker-entrypoint-initdb.d:/docker-entrypoint-initdb.d
76

77
  superset:
78
    env_file:
79
      - path: docker/.env # default
80
        required: true
81
      - path: docker/.env-local # optional override
82
        required: false
83
    build:
84
      <<: *common-build
85
    container_name: superset_app
86
    command: ["/app/docker/docker-bootstrap.sh", "app"]
87
    restart: unless-stopped
88
    ports:
89
      - 8088:8088
90
    extra_hosts:
91
      - "host.docker.internal:host-gateway"
92
    user: *superset-user
93
    depends_on: *superset-depends-on
94
    volumes: *superset-volumes
95
    environment:
96
      CYPRESS_CONFIG: "${CYPRESS_CONFIG:-}"
97

98
  superset-websocket:
99
    container_name: superset_websocket
100
    build: ./superset-websocket
101
    ports:
102
      - 8080:8080
103
    extra_hosts:
104
      - "host.docker.internal:host-gateway"
105
    depends_on:
106
      - redis
107
    # Mount everything in superset-websocket into container and
108
    # then exclude node_modules and dist with bogus volume mount.
109
    # This is necessary because host and container need to have
110
    # their own, separate versions of these files. .dockerignore
111
    # does not seem to work when starting the service through
112
    # 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 container
116
    # OS is not necessarily the same as host OS.
117
    volumes:
118
      - ./superset-websocket:/home/superset-websocket
119
      - /home/superset-websocket/node_modules
120
      - /home/superset-websocket/dist
121

122
      # Mounting a config file that contains a dummy secret required to boot up.
123
      # do not use this docker-compose in production
124
      - ./docker/superset-websocket/config.json:/home/superset-websocket/config.json
125
    environment:
126
      - PORT=8080
127
      - REDIS_HOST=redis
128
      - REDIS_PORT=6379
129
      - REDIS_SSL=false
130

131
  superset-init:
132
    build:
133
      <<: *common-build
134
    container_name: superset_init
135
    command: ["/app/docker/docker-init.sh"]
136
    env_file:
137
      - path: docker/.env # default
138
        required: true
139
      - path: docker/.env-local # optional override
140
        required: false
141
    depends_on: *superset-depends-on
142
    user: *superset-user
143
    volumes: *superset-volumes
144
    environment:
145
      CYPRESS_CONFIG: "${CYPRESS_CONFIG:-}"
146
    healthcheck:
147
      disable: true
148

149
  superset-node:
150
    image: node:18
151
    environment:
152
      # set this to false if you have perf issues running the npm i; npm run dev in-docker
153
      # if you do so, you have to run this manually on the host, which should perform better!
154
      SCARF_ANALYTICS: "${SCARF_ANALYTICS:-}"
155
    container_name: superset_node
156
    command: ["/app/docker/docker-frontend.sh"]
157
    env_file:
158
      - path: docker/.env # default
159
        required: true
160
      - path: docker/.env-local # optional override
161
        required: false
162
    depends_on: *superset-depends-on
163
    volumes: *superset-volumes
164

165
  superset-worker:
166
    build:
167
      <<: *common-build
168
    container_name: superset_worker
169
    command: ["/app/docker/docker-bootstrap.sh", "worker"]
170
    env_file:
171
      - path: docker/.env # default
172
        required: true
173
      - path: docker/.env-local # optional override
174
        required: false
175
    environment:
176
      CELERYD_CONCURRENCY: 2
177
    restart: unless-stopped
178
    depends_on: *superset-depends-on
179
    user: *superset-user
180
    volumes: *superset-volumes
181
    extra_hosts:
182
      - "host.docker.internal:host-gateway"
183
    healthcheck:
184
      test: ["CMD-SHELL", "celery -A superset.tasks.celery_app:app inspect ping -d celery@$$HOSTNAME"]
185
    # Bump memory limit if processing selenium / thumbnails on superset-worker
186
    # mem_limit: 2038m
187
    # mem_reservation: 128M
188

189
  superset-worker-beat:
190
    build:
191
      <<: *common-build
192
    container_name: superset_worker_beat
193
    command: ["/app/docker/docker-bootstrap.sh", "beat"]
194
    env_file:
195
      - path: docker/.env # default
196
        required: true
197
      - path: docker/.env-local # optional override
198
        required: false
199
    restart: unless-stopped
200
    depends_on: *superset-depends-on
201
    user: *superset-user
202
    volumes: *superset-volumes
203
    healthcheck:
204
      disable: true
205

206
  superset-tests-worker:
207
    build:
208
      <<: *common-build
209
    container_name: superset_tests_worker
210
    command: ["/app/docker/docker-bootstrap.sh", "worker"]
211
    env_file:
212
      - path: docker/.env # default
213
        required: true
214
      - path: docker/.env-local # optional override
215
        required: false
216
    profiles:
217
      - optional
218
    environment:
219
      DATABASE_HOST: localhost
220
      DATABASE_DB: test
221
      REDIS_CELERY_DB: 2
222
      REDIS_RESULTS_DB: 3
223
      REDIS_HOST: localhost
224
      CELERYD_CONCURRENCY: 8
225
    network_mode: host
226
    depends_on: *superset-depends-on
227
    user: *superset-user
228
    volumes: *superset-volumes
229
    healthcheck:
230
      test: ["CMD-SHELL", "celery inspect ping -A superset.tasks.celery_app:app -d celery@$$HOSTNAME"]
231

232
volumes:
233
  superset_home:
234
    external: false
235
  db_home:
236
    external: false
237
  redis:
238
    external: false
239

Использование cookies

Мы используем файлы cookie в соответствии с Политикой конфиденциальности и Политикой использования cookies.

Нажимая кнопку «Принимаю», Вы даете АО «СберТех» согласие на обработку Ваших персональных данных в целях совершенствования нашего веб-сайта и Сервиса GitVerse, а также повышения удобства их использования.

Запретить использование cookies Вы можете самостоятельно в настройках Вашего браузера.