-
Notifications
You must be signed in to change notification settings - Fork 14k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: docker-compose to work off repo Dockerfile #27434
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,101 @@ | ||
# | ||
# 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. | ||
# | ||
x-superset-image: &superset-image apachesuperset.docker.scarf.sh/apache/superset:${TAG:-latest} | ||
x-superset-depends-on: &superset-depends-on | ||
- db | ||
- redis | ||
x-superset-volumes: | ||
&superset-volumes # /app/pythonpath_docker will be appended to the PYTHONPATH in the final container | ||
- ./docker:/app/docker | ||
- superset_home:/app/superset_home | ||
|
||
version: "3.7" | ||
services: | ||
redis: | ||
image: redis:7 | ||
container_name: superset_cache | ||
restart: unless-stopped | ||
volumes: | ||
- redis:/data | ||
|
||
db: | ||
env_file: docker/.env | ||
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: docker/.env | ||
image: *superset-image | ||
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: | ||
image: *superset-image | ||
container_name: superset_init | ||
command: ["/app/docker/docker-init.sh"] | ||
env_file: docker/.env | ||
depends_on: *superset-depends-on | ||
user: "root" | ||
volumes: *superset-volumes | ||
healthcheck: | ||
disable: true | ||
|
||
superset-worker: | ||
image: *superset-image | ||
container_name: superset_worker | ||
command: ["/app/docker/docker-bootstrap.sh", "worker"] | ||
env_file: docker/.env | ||
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: | ||
image: *superset-image | ||
container_name: superset_worker_beat | ||
command: ["/app/docker/docker-bootstrap.sh", "beat"] | ||
env_file: docker/.env | ||
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 |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,7 +14,6 @@ | |
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
# | ||
x-superset-image: &superset-image apachesuperset.docker.scarf.sh/apache/superset:${TAG:-latest} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I personally think it's kind of cool to have There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. About this, I think both use cases are valid. To me if I'm in a repo and on a specific ref (a branch, a release tag, or my own little branch with a feature), and I run some docker-related thing (whether it's I think the 2 options I want to provide here are really just "interactive" where we mount the code, and "non-interactive" where it's just immutable set of dockers that get me a fully working testable cluster that is lined up with the branch. Now maybe we should ADD a new way to do There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. fine by me! makes sense There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ok, I'm making a bunch of changes here and re-writing the docs too... |
||
x-superset-depends-on: &superset-depends-on | ||
- db | ||
- redis | ||
|
@@ -23,7 +22,13 @@ x-superset-volumes: | |
- ./docker:/app/docker | ||
- superset_home:/app/superset_home | ||
|
||
version: "3.7" | ||
x-common-build: &common-build | ||
context: . | ||
target: dev | ||
cache_from: | ||
- apache/superset-cache:3.9-slim-bookworm | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. oh I was not aware of this, what process pushes to it? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Anything that uses Docker-compose can piggy backing on this cache here that should really speed up the builds since in most case most layers can be re-used from the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. got it:
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. side note - one thing I noticed is cache doesn't always seem to hit when I think it should, I'm guessing that we have some limits / intelligent cache pruning that's preventing cache hit from always working .... cache hit rate is still pretty decent, and build times not awful either when missing the cache |
||
|
||
version: "4.0" | ||
services: | ||
redis: | ||
image: redis:7 | ||
|
@@ -33,7 +38,7 @@ services: | |
- redis:/data | ||
|
||
db: | ||
env_file: docker/.env-non-dev | ||
env_file: docker/.env | ||
image: postgres:15 | ||
container_name: superset_db | ||
restart: unless-stopped | ||
|
@@ -42,8 +47,9 @@ services: | |
- ./docker/docker-entrypoint-initdb.d:/docker-entrypoint-initdb.d | ||
|
||
superset: | ||
env_file: docker/.env-non-dev | ||
image: *superset-image | ||
env_file: docker/.env | ||
build: | ||
<<: *common-build | ||
container_name: superset_app | ||
command: ["/app/docker/docker-bootstrap.sh", "app-gunicorn"] | ||
user: "root" | ||
|
@@ -54,21 +60,23 @@ services: | |
volumes: *superset-volumes | ||
|
||
superset-init: | ||
image: *superset-image | ||
container_name: superset_init | ||
build: | ||
<<: *common-build | ||
command: ["/app/docker/docker-init.sh"] | ||
env_file: docker/.env-non-dev | ||
env_file: docker/.env | ||
depends_on: *superset-depends-on | ||
user: "root" | ||
volumes: *superset-volumes | ||
healthcheck: | ||
disable: true | ||
|
||
superset-worker: | ||
image: *superset-image | ||
build: | ||
<<: *common-build | ||
container_name: superset_worker | ||
command: ["/app/docker/docker-bootstrap.sh", "worker"] | ||
env_file: docker/.env-non-dev | ||
env_file: docker/.env | ||
restart: unless-stopped | ||
depends_on: *superset-depends-on | ||
user: "root" | ||
|
@@ -81,10 +89,11 @@ services: | |
] | ||
|
||
superset-worker-beat: | ||
image: *superset-image | ||
build: | ||
<<: *common-build | ||
container_name: superset_worker_beat | ||
command: ["/app/docker/docker-bootstrap.sh", "beat"] | ||
env_file: docker/.env-non-dev | ||
env_file: docker/.env | ||
restart: unless-stopped | ||
depends_on: *superset-depends-on | ||
user: "root" | ||
|
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this file is effectively the old
docker-compose-non-dev.yml
just renamed to be more clear