diff --git a/linux/advanced/redash/Dockerfile b/linux/advanced/redash/Dockerfile index cf1ae9a38..91b31195f 100644 --- a/linux/advanced/redash/Dockerfile +++ b/linux/advanced/redash/Dockerfile @@ -87,13 +87,13 @@ ENV PIP_NO_CACHE_DIR=1 RUN pip install pip==20.2.4; # We first copy only the requirements file, to avoid rebuilding on every file change. -COPY requirements_all_ds.txt ./ +COPY ./redash-repo/requirements_all_ds.txt ./ RUN if [ "x$skip_ds_deps" = "x" ] ; then pip install -r requirements_all_ds.txt ; else echo "Skipping pip install -r requirements_all_ds.txt" ; fi -COPY requirements_bundles.txt requirements_dev.txt ./ +COPY ./redash-repo/requirements_bundles.txt ./redash-repo/requirements_dev.txt ./ RUN if [ "x$skip_dev_deps" = "x" ] ; then pip install -r requirements_dev.txt ; fi -COPY requirements.txt ./ +COPY ./redash-repo/requirements.txt ./ RUN pip install -r requirements.txt COPY . /app diff --git a/linux/advanced/redash/Makefile b/linux/advanced/redash/Makefile index a4e0946b0..5e2a7a25a 100644 --- a/linux/advanced/redash/Makefile +++ b/linux/advanced/redash/Makefile @@ -1,6 +1,30 @@ all: app app: + make sync + make patch + make build + make push + make clean + +sync: + rm -rfv redash-repo git submodule init git submodule update --init --recursive git submodule sync --recursive + +patch: + sed -i -e 's/# ldap3==2.2.4/ldap3==2.2.4/g' ./redash-repo/requirements.txt + +build: + docker-compose build --compress + +push: + docker-compose push + +clean: + docker container prune -f + docker image prune -f + docker network prune -f + docker volume prune -f + docker system prune -af diff --git a/linux/advanced/redash/docker-compose.example.yml b/linux/advanced/redash/docker-compose.example.yml new file mode 100644 index 000000000..82bcd245f --- /dev/null +++ b/linux/advanced/redash/docker-compose.example.yml @@ -0,0 +1,65 @@ +# This configuration file is for the **development** setup. +# For a production example please refer to getredash/setup repository on GitHub. +version: "2.2" +x-redash-service: &redash-service + build: + context: . + args: + skip_frontend_build: "true" + volumes: + - .:/app +x-redash-environment: &redash-environment + REDASH_LOG_LEVEL: "INFO" + REDASH_REDIS_URL: "redis://redis:6379/0" + REDASH_DATABASE_URL: "postgresql://postgres@postgres/postgres" + REDASH_RATELIMIT_ENABLED: "false" + REDASH_MAIL_DEFAULT_SENDER: "redash@example.com" + REDASH_MAIL_SERVER: "email" + REDASH_ENFORCE_CSRF: "true" +services: + server: + <<: *redash-service + command: dev_server + depends_on: + - postgres + - redis + ports: + - "5000:5000" + - "5678:5678" + environment: + <<: *redash-environment + PYTHONUNBUFFERED: 0 + scheduler: + <<: *redash-service + command: dev_scheduler + depends_on: + - server + environment: + <<: *redash-environment + worker: + <<: *redash-service + command: dev_worker + depends_on: + - server + environment: + <<: *redash-environment + PYTHONUNBUFFERED: 0 + redis: + image: redis:3-alpine + restart: unless-stopped + postgres: + image: postgres:9.5-alpine + # The following turns the DB into less durable, but gains significant performance improvements for the tests run (x3 + # improvement on my personal machine). We should consider moving this into a dedicated Docker Compose configuration for + # tests. + ports: + - "15432:5432" + command: "postgres -c fsync=off -c full_page_writes=off -c synchronous_commit=OFF" + restart: unless-stopped + environment: + POSTGRES_HOST_AUTH_METHOD: "trust" + email: + image: djfarrelly/maildev + ports: + - "1080:80" + restart: unless-stopped diff --git a/linux/advanced/redash/docker-compose.yml b/linux/advanced/redash/docker-compose.yml index 82bcd245f..5a89409da 100644 --- a/linux/advanced/redash/docker-compose.yml +++ b/linux/advanced/redash/docker-compose.yml @@ -1,65 +1,6 @@ -# This configuration file is for the **development** setup. -# For a production example please refer to getredash/setup repository on GitHub. -version: "2.2" -x-redash-service: &redash-service - build: - context: . - args: - skip_frontend_build: "true" - volumes: - - .:/app -x-redash-environment: &redash-environment - REDASH_LOG_LEVEL: "INFO" - REDASH_REDIS_URL: "redis://redis:6379/0" - REDASH_DATABASE_URL: "postgresql://postgres@postgres/postgres" - REDASH_RATELIMIT_ENABLED: "false" - REDASH_MAIL_DEFAULT_SENDER: "redash@example.com" - REDASH_MAIL_SERVER: "email" - REDASH_ENFORCE_CSRF: "true" +version: '3.9' services: - server: - <<: *redash-service - command: dev_server - depends_on: - - postgres - - redis - ports: - - "5000:5000" - - "5678:5678" - environment: - <<: *redash-environment - PYTHONUNBUFFERED: 0 - scheduler: - <<: *redash-service - command: dev_scheduler - depends_on: - - server - environment: - <<: *redash-environment - worker: - <<: *redash-service - command: dev_worker - depends_on: - - server - environment: - <<: *redash-environment - PYTHONUNBUFFERED: 0 - redis: - image: redis:3-alpine - restart: unless-stopped - postgres: - image: postgres:9.5-alpine - # The following turns the DB into less durable, but gains significant performance improvements for the tests run (x3 - # improvement on my personal machine). We should consider moving this into a dedicated Docker Compose configuration for - # tests. - ports: - - "15432:5432" - command: "postgres -c fsync=off -c full_page_writes=off -c synchronous_commit=OFF" - restart: unless-stopped - environment: - POSTGRES_HOST_AUTH_METHOD: "trust" - email: - image: djfarrelly/maildev - ports: - - "1080:80" - restart: unless-stopped + app: + image: "epicmorg/redash:latest" + build: + context: .