diff --git a/.devcontainer/base/docker-compose.yaml b/.devcontainer/base/docker-compose.yaml index 4c077a40e9..6c27f756f9 100644 --- a/.devcontainer/base/docker-compose.yaml +++ b/.devcontainer/base/docker-compose.yaml @@ -1,3 +1,9 @@ +x-build-cache: &build-cache + cache_from: + - type=gha + cache_to: + - type=gha,mode=max + services: devcontainer: @@ -5,6 +11,7 @@ services: build: context: ../.. dockerfile: .devcontainer/base/Dockerfile + <<: *build-cache volumes: - ../../:/workspaces:cached command: sleep infinity @@ -56,6 +63,7 @@ services: build: context: ../../apps/login/acceptance/setup dockerfile: ../go-command.Dockerfile + <<: *build-cache entrypoint: "./setup.sh" network_mode: service:devcontainer environment: @@ -92,6 +100,7 @@ services: dockerfile: ../go-command.Dockerfile args: - LOGIN_TEST_ACCEPTANCE_GOLANG_TAG=${LOGIN_TEST_ACCEPTANCE_GOLANG_TAG:-golang:1.24-alpine} + <<: *build-cache environment: PORT: '3333' command: @@ -116,6 +125,7 @@ services: dockerfile: ../go-command.Dockerfile args: - LOGIN_TEST_ACCEPTANCE_GOLANG_TAG=${LOGIN_TEST_ACCEPTANCE_GOLANG_TAG:-golang:1.24-alpine} + <<: *build-cache network_mode: service:devcontainer environment: API_URL: 'http://localhost:8080' @@ -139,6 +149,7 @@ services: # dockerfile: ../../go-command.Dockerfile # args: # - LOGIN_TEST_ACCEPTANCE_GOLANG_TAG=${LOGIN_TEST_ACCEPTANCE_GOLANG_TAG:-golang:1.24-alpine} + # <<: *build-cache # network_mode: service:devcontainer # environment: # API_URL: 'http://localhost:8080' @@ -160,6 +171,7 @@ services: dockerfile: ../go-command.Dockerfile args: - LOGIN_TEST_ACCEPTANCE_GOLANG_TAG=${LOGIN_TEST_ACCEPTANCE_GOLANG_TAG:-golang:1.24-alpine} + <<: *build-cache network_mode: service:devcontainer environment: API_URL: 'http://localhost:8080' @@ -174,27 +186,27 @@ services: depends_on: configure-login: condition: "service_completed_successfully" - -# mock-samlidp: -# container_name: mock-samlidp -# build: -# context: ../../apps/login/acceptance/idp/saml -# dockerfile: ../../go-command.Dockerfile -# args: -# - LOGIN_TEST_ACCEPTANCE_GOLANG_TAG=${LOGIN_TEST_ACCEPTANCE_GOLANG_TAG:-golang:1.24-alpine} -# network_mode: service:devcontainer -# environment: -# API_URL: 'http://localhost:8080' -# API_DOMAIN: 'localhost' -# PAT_FILE: '/pat/zitadel-admin-sa.pat' -# SCHEMA: 'http' -# HOST: 'localhost' -# PORT: "8003" -# volumes: -# - "../apps/login/packages/acceptance/pat:/pat" -# depends_on: -# configure-login: -# condition: "service_completed_successfully" + # mock-samlidp: + # container_name: mock-samlidp + # build: + # context: ../../apps/login/acceptance/idp/saml + # dockerfile: ../../go-command.Dockerfile + # args: + # - LOGIN_TEST_ACCEPTANCE_GOLANG_TAG=${LOGIN_TEST_ACCEPTANCE_GOLANG_TAG:-golang:1.24-alpine} + # <<: *build-cache + # network_mode: service:devcontainer + # environment: + # API_URL: 'http://localhost:8080' + # API_DOMAIN: 'localhost' + # PAT_FILE: '/pat/zitadel-admin-sa.pat' + # SCHEMA: 'http' + # HOST: 'localhost' + # PORT: "8003" + # volumes: + # - "../apps/login/packages/acceptance/pat:/pat" + # depends_on: + # configure-login: + # condition: "service_completed_successfully" volumes: postgres-data: diff --git a/.devcontainer/login-integration/docker-compose.yaml b/.devcontainer/login-integration/docker-compose.yaml index 06c43ea836..d65897a24d 100644 --- a/.devcontainer/login-integration/docker-compose.yaml +++ b/.devcontainer/login-integration/docker-compose.yaml @@ -21,6 +21,10 @@ services: container_name: mock-zitadel build: context: ../../apps/login/integration/core-mock + cache_from: + - type=gha + cache_to: + - type=gha,mode=max ports: - 22220:22220 - 22222:22222 diff --git a/.github/workflows/login-container.yml b/.github/workflows/login-container.yml index e529fc6269..0d8cab84d0 100644 --- a/.github/workflows/login-container.yml +++ b/.github/workflows/login-container.yml @@ -60,6 +60,9 @@ jobs: provenance: true sbom: true targets: login-standalone + set: | + *.cache-from=type=gha + *.cache-to=type=gha,mode=max files: | ./apps/login/docker-bake.hcl ./apps/login/docker-bake-release.hcl diff --git a/package.json b/package.json index 190d8e03f9..f5988b8381 100644 --- a/package.json +++ b/package.json @@ -8,12 +8,12 @@ "devcontainer": "devcontainer", "devcontainer:lint-unit": "npm run devcontainer:lint-unit:build && npm run devcontainer:lint-unit:up", "devcontainer:lint-unit:build": "devcontainer build --config .devcontainer/turbo-lint-unit/devcontainer.json --workspace-folder .", - "devcontainer:lint-unit:up": "devcontainer up --prebuild --config .devcontainer/turbo-lint-unit/devcontainer.json --workspace-folder . --remove-existing-container", + "devcontainer:lint-unit:up": "devcontainer up --config .devcontainer/turbo-lint-unit/devcontainer.json --workspace-folder . --remove-existing-container", "devcontainer:integration:login": "npm run devcontainer:integration:login:build && npm run devcontainer:integration:login:up", "devcontainer:integration:login:build": "npm run devcontainer:integration:login:build:env && npm run devcontainer:integration:login:build:services", "devcontainer:integration:login:build:env": "devcontainer build --config .devcontainer/login-integration/devcontainer.json --workspace-folder .", "devcontainer:integration:login:build:services": "COMPOSE_BAKE=1 docker compose --file .devcontainer/base/docker-compose.yaml --file .devcontainer/login-integration/docker-compose.yaml build login-integration", - "devcontainer:integration:login:up": "devcontainer up --prebuild --config .devcontainer/login-integration/devcontainer.json --workspace-folder . --remove-existing-container", + "devcontainer:integration:login:up": "devcontainer up --log-level trace --config .devcontainer/login-integration/devcontainer.json --workspace-folder . --remove-existing-container", "clean": "turbo run clean", "clean:all": "pnpm run clean && rm -rf .turbo node_modules" },