docker-compose.yml 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  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. x-superset-build: &superset-build
  18. context: ./
  19. dockerfile: Dockerfile
  20. target: dev
  21. x-superset-depends-on: &superset-depends-on
  22. - db
  23. - redis
  24. x-superset-volumes: &superset-volumes
  25. # /app/pythonpath_docker will be appended to the PYTHONPATH in the final container
  26. - ./docker/docker-init.sh:/app/docker-init.sh
  27. - ./docker/pythonpath_dev:/app/pythonpath
  28. - ./superset:/app/superset
  29. - ./superset-frontend:/app/superset-frontend
  30. - superset_home:/app/superset_home
  31. version: "3.7"
  32. services:
  33. redis:
  34. image: redis:3.2
  35. restart: unless-stopped
  36. ports:
  37. - "127.0.0.1:6379:6379"
  38. volumes:
  39. - redis:/data
  40. db:
  41. env_file: docker/.env
  42. image: postgres:10
  43. restart: unless-stopped
  44. ports:
  45. - "127.0.0.1:5432:5432"
  46. volumes:
  47. - db_home:/var/lib/postgresql/data
  48. superset:
  49. build: *superset-build
  50. command: ["flask", "run", "-p", "8088", "--with-threads", "--reload", "--debugger", "--host=0.0.0.0"]
  51. env_file: docker/.env
  52. restart: unless-stopped
  53. ports:
  54. - 8088:8088
  55. depends_on: *superset-depends-on
  56. volumes: *superset-volumes
  57. superset-init:
  58. build: *superset-build
  59. command: ["/app/docker-init.sh"]
  60. env_file: docker/.env
  61. depends_on: *superset-depends-on
  62. volumes: *superset-volumes
  63. superset-node:
  64. image: node:10-jessie
  65. command: ["bash", "-c", "cd /app/superset-frontend && npm install && npm run dev"]
  66. env_file: docker/.env
  67. depends_on: *superset-depends-on
  68. volumes: *superset-volumes
  69. superset-worker:
  70. build: *superset-build
  71. command: ["celery", "worker", "--app=superset.tasks.celery_app:app", "-Ofair"]
  72. env_file: docker/.env
  73. restart: unless-stopped
  74. depends_on: *superset-depends-on
  75. volumes: *superset-volumes
  76. volumes:
  77. superset_home:
  78. external: false
  79. db_home:
  80. external: false
  81. redis:
  82. external: false