Skip to content

Commit

Permalink
chore: rename containers to docker (#193)
Browse files Browse the repository at this point in the history
Update the Docker folder and associated workflows.
  • Loading branch information
patheard authored Nov 6, 2024
1 parent 0a65eda commit 0eff381
Show file tree
Hide file tree
Showing 14 changed files with 27 additions and 28 deletions.
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@

name: Container build and push
name: Docker build and push
on:
push:
branches:
- main
paths:
- "containers/**"
- ".github/workflows/containers-apply.yml"
- "docker/**"
- ".github/workflows/docker-apply.yml"

env:
AWS_REGION: ca-central-1
Expand Down Expand Up @@ -48,9 +48,9 @@ jobs:
working-directory: ./
run: |
docker build \
--file ./containers/Dockerfile \
--file ./docker/Dockerfile \
--tag $REGISTRY:sha-$GITHUB_SHA \
--tag $REGISTRY:latest ./containers
--tag $REGISTRY:latest ./docker
- name: Push Container to Amazon ECR
run: |
Expand All @@ -63,6 +63,6 @@ jobs:
TRIVY_DB_REPOSITORY: ${{ vars.TRIVY_DB_REPOSITORY }}
with:
docker_image: "${{ env.REGISTRY }}:latest"
dockerfile_path: "./Dockerfile"
dockerfile_path: "./docker/Dockerfile"
sbom_name: "cds-superset"
token: "${{ secrets.GITHUB_TOKEN }}"
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Containers deploy
name: Docker deploy

on:
workflow_run:
Expand All @@ -16,7 +16,7 @@ permissions:
id-token: write

jobs:
containers-deploy:
docker-deploy:
if: ${{ github.event.workflow_run.conclusion == 'success' }}
runs-on: ubuntu-latest
strategy:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@

name: Container Pull Request
name: Docker Pull Request
on:
pull_request:
paths:
- "containers/**"
- ".github/workflows/containers-pr.yml"
- "docker/**"
- ".github/workflows/docker-pr.yml"

jobs:
containers-hadolint:

docker-hadolint:
runs-on: ubuntu-latest
permissions:
contents: read # for actions/checkout to fetch code
Expand All @@ -31,7 +30,7 @@ jobs:
id: hadolint
uses: hadolint/hadolint-action@54c9adbab1582c2ef04b2016b760714a4bfde3cf # v3.1.0
with:
dockerfile: ./containers/Dockerfile
dockerfile: ./docker/Dockerfile
format: sarif
output-file: hadolint-results.sarif
no-fail: true
Expand Down Expand Up @@ -78,6 +77,6 @@ jobs:

- name: Build Docker image
run: |
docker build --file ./containers/Dockerfile \
docker build --file ./docker/Dockerfile \
--tag ${{ github.repository }}:${{ github.sha }} \
./containers
./docker
2 changes: 1 addition & 1 deletion .github/workflows/docker-vulnerability-scan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
TRIVY_DB_REPOSITORY: ${{ vars.TRIVY_DB_REPOSITORY }}
with:
docker_image: "${{ env.REGISTRY }}:latest"
dockerfile_path: "./containers/Dockerfile"
dockerfile_path: "./docker/Dockerfile"
token: ${{ secrets.GITHUB_TOKEN }}

- name: Logout of Amazon ECR
Expand Down
10 changes: 5 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ apply:

build:
@docker build \
--file ./containers/Dockerfile \
--tag superset:latest ./containers
--file ./docker/Dockerfile \
--tag superset:latest ./docker

localhost:
@docker compose up
Expand All @@ -32,10 +32,10 @@ plan:
--terragrunt-working-dir terragrunt

install_dev:
@pip install -r ./containers/requirements_dev.txt
@pip install -r ./docker/requirements_dev.txt

fmt: install_dev
black ./containers $(ARGS)
black ./docker $(ARGS)

lint: install_dev
flake8 ./containers
flake8 ./docker
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ A modern, enterprise-ready business intelligence web application.
## Setup

### AWS
1. Update the configuration in `./containers/superset_config.py`.
1. Update the configuration in `./docker/superset_config.py`.
2. Build the Docker image with `make build`.
3. Run Terraform apply with `make apply`.
4. Create the database and admin user:
Expand Down
6 changes: 3 additions & 3 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
x-superset-build:
&superset-build
context: ./containers
context: ./docker
dockerfile: Dockerfile
x-superset-depends-on: &superset-depends-on
- db
- redis
x-superset-env:
&superset-env
- path: containers/.env.local
- path: docker/.env.local
required: true
x-superset-volumes:
&superset-volumes
- ./containers:/app/docker
- ./docker:/app/docker
- superset_home:/app/superset_home

services:
Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions containers/Dockerfile → docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ USER root
# Add required database driver packages
# https://superset.apache.org/installation.html#database-dependencies
COPY requirements.txt /app/requirements.txt
RUN pip install --no-cache -r /app/requirements.txt
RUN pip install --no-cache-dir -r /app/requirements.txt
ENV REQUIREMENTS_LOCAL=/app/requirements.txt

# Custom bootstrap script
Expand All @@ -13,6 +13,6 @@ COPY docker-bootstrap.sh /app/docker/docker-bootstrap.sh
# Add custom configuration
# https://superset.apache.org/docs/installation/configuring-superset/#configuring-superset
COPY superset_config.py /app/superset_config.py
ENV SUPERSET_CONFIG_PATH /app/superset_config.py
ENV SUPERSET_CONFIG_PATH=/app/superset_config.py

USER superset
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 0eff381

Please sign in to comment.