mirror of
https://github.com/zitadel/zitadel.git
synced 2025-08-11 13:07:46 +00:00
fix login containers
This commit is contained in:
@@ -12,11 +12,6 @@ RUN apt-get update && \
|
|||||||
apt-get --no-install-recommends install -y \
|
apt-get --no-install-recommends install -y \
|
||||||
libgtk2.0-0 libgtk-3-0 libgbm-dev libnotify-dev libnss3 libxss1 libasound2 libxtst6 xauth xvfb && \
|
libgtk2.0-0 libgtk-3-0 libgbm-dev libnotify-dev libnss3 libxss1 libasound2 libxtst6 xauth xvfb && \
|
||||||
apt-get clean && \
|
apt-get clean && \
|
||||||
corepack enable && COREPACK_ENABLE_DOWNLOAD_PROMPT=0 corepack prepare pnpm@9.1.2 --activate
|
corepack enable && COREPACK_ENABLE_DOWNLOAD_PROMPT=0 corepack prepare pnpm@10.13.1 --activate
|
||||||
|
|
||||||
USER node
|
USER node
|
||||||
WORKDIR /home/node/preinstall
|
|
||||||
COPY pnpm-lock.yaml ./
|
|
||||||
RUN pnpm fetch
|
|
||||||
RUN cd /home/node && pwd && ls -la && whoami
|
|
||||||
RUN pnpm store path
|
|
@@ -1,4 +1 @@
|
|||||||
*
|
*
|
||||||
!pnpm-lock.yaml
|
|
||||||
!pnpm-workspace.yaml
|
|
||||||
!**/package.json
|
|
@@ -1,20 +1,13 @@
|
|||||||
{
|
{
|
||||||
"$schema": "https://raw.githubusercontent.com/devcontainers/spec/refs/heads/main/schemas/devContainer.schema.json",
|
"$schema": "https://raw.githubusercontent.com/devcontainers/spec/refs/heads/main/schemas/devContainer.schema.json",
|
||||||
"name": "devcontainer",
|
"name": "Base Container. Install and run Components yourself",
|
||||||
"dockerComposeFile": "docker-compose.yml",
|
"dockerComposeFile": "docker-compose.yaml",
|
||||||
"service": "devcontainer",
|
"service": "devcontainer",
|
||||||
"runServices": [
|
"runServices": [
|
||||||
"devContainer",
|
"devContainer",
|
||||||
"db"
|
"db"
|
||||||
],
|
],
|
||||||
"workspaceFolder": "/workspaces",
|
"workspaceFolder": "/workspaces",
|
||||||
"features": {
|
|
||||||
"ghcr.io/devcontainers/features/go:1": {
|
|
||||||
"version": "1.24"
|
|
||||||
},
|
|
||||||
"ghcr.io/guiyomh/features/golangci-lint:0": {},
|
|
||||||
"ghcr.io/jungaretti/features/make:1": {}
|
|
||||||
},
|
|
||||||
"forwardPorts": [
|
"forwardPorts": [
|
||||||
3000,
|
3000,
|
||||||
3001,
|
3001,
|
||||||
@@ -22,11 +15,12 @@
|
|||||||
8080
|
8080
|
||||||
],
|
],
|
||||||
"onCreateCommand": "pnpm install --frozen-lockfile --recursive --prefer-offline",
|
"onCreateCommand": "pnpm install --frozen-lockfile --recursive --prefer-offline",
|
||||||
"customizations": {
|
"features": {
|
||||||
"jetbrains": {
|
"ghcr.io/devcontainers/features/go:1": {
|
||||||
"settings": {
|
"version": "1.24"
|
||||||
"com.intellij:app:HttpConfigurable.use_proxy_pac": true
|
},
|
||||||
}
|
"ghcr.io/guiyomh/features/golangci-lint:0": {},
|
||||||
}
|
"ghcr.io/jungaretti/features/make:1": {},
|
||||||
|
"ghcr.io/devcontainers/features/docker-outside-of-docker": {}
|
||||||
}
|
}
|
||||||
}
|
}
|
@@ -31,32 +31,9 @@ services:
|
|||||||
ports:
|
ports:
|
||||||
- "5432:5432"
|
- "5432:5432"
|
||||||
|
|
||||||
mock-zitadel:
|
|
||||||
container_name: mock-zitadel
|
|
||||||
build:
|
|
||||||
context: ../../apps/login/integration/core-mock
|
|
||||||
ports:
|
|
||||||
- 22220:22220
|
|
||||||
- 22222:22222
|
|
||||||
|
|
||||||
login-integration:
|
|
||||||
container_name: login-integration
|
|
||||||
build:
|
|
||||||
context: ../..
|
|
||||||
dockerfile: build/login/Dockerfile
|
|
||||||
image: "${LOGIN_TAG:-zitadel-login:local}"
|
|
||||||
env_file: ../../apps/login/.env.test
|
|
||||||
network_mode: service:mock-zitadel
|
|
||||||
environment:
|
|
||||||
NODE_ENV: test
|
|
||||||
PORT: 3001
|
|
||||||
depends_on:
|
|
||||||
mock-zitadel:
|
|
||||||
condition: service_started
|
|
||||||
|
|
||||||
zitadel:
|
zitadel:
|
||||||
image: "${ZITADEL_TAG:-ghcr.io/zitadel/zitadel:v4.0.0-rc.2}"
|
|
||||||
container_name: zitadel
|
container_name: zitadel
|
||||||
|
image: "${ZITADEL_TAG:-ghcr.io/zitadel/zitadel:v4.0.0-rc.2}"
|
||||||
command: 'start-from-init --masterkey "MasterkeyNeedsToHave32Characters" --config /zitadel.yaml --steps /zitadel.yaml'
|
command: 'start-from-init --masterkey "MasterkeyNeedsToHave32Characters" --config /zitadel.yaml --steps /zitadel.yaml'
|
||||||
volumes:
|
volumes:
|
||||||
- ../../apps/login/acceptance/pat:/pat:delegated
|
- ../../apps/login/acceptance/pat:/pat:delegated
|
@@ -1,9 +1,10 @@
|
|||||||
{
|
{
|
||||||
"$schema": "https://raw.githubusercontent.com/devcontainers/spec/refs/heads/main/schemas/devContainer.schema.json",
|
"$schema": "https://raw.githubusercontent.com/devcontainers/spec/refs/heads/main/schemas/devContainer.schema.json",
|
||||||
"name": "login-integration-debug",
|
"name": "Login Integration Hot Reload Container - Debug and Fix Pull Request Checks",
|
||||||
"dockerComposeFile": [
|
"dockerComposeFile": [
|
||||||
"../base/docker-compose.yml",
|
"../base/docker-compose.yaml",
|
||||||
"docker-compose.yml"
|
"../login-integration/docker-compose.yaml",
|
||||||
|
"docker-compose.yaml"
|
||||||
],
|
],
|
||||||
"service": "login-integration",
|
"service": "login-integration",
|
||||||
"runServices": [
|
"runServices": [
|
||||||
@@ -11,8 +12,13 @@
|
|||||||
],
|
],
|
||||||
"workspaceFolder": "/workspaces",
|
"workspaceFolder": "/workspaces",
|
||||||
"forwardPorts": [
|
"forwardPorts": [
|
||||||
|
22220,
|
||||||
|
22222,
|
||||||
3001
|
3001
|
||||||
],
|
],
|
||||||
"onCreateCommand": "pnpm install --filter . --filter @zitadel/login; cd apps/login; pnpm cypress install",
|
"onCreateCommand": "pnpm install --filter . --filter @zitadel/login; cd apps/login; pnpm cypress install",
|
||||||
"postAttachCommand": "pnpm turbo daemon clean || true; pnpm turbo watch @zitadel/login#dev test:integration:login"
|
"postAttachCommand": "pnpm turbo daemon clean || true; pnpm turbo watch @zitadel/login#dev test:integration:login",
|
||||||
|
"features": {
|
||||||
|
"ghcr.io/devcontainers/features/docker-outside-of-docker": {}
|
||||||
|
}
|
||||||
}
|
}
|
@@ -2,5 +2,5 @@ services:
|
|||||||
login-integration:
|
login-integration:
|
||||||
container_name: login-integration-debug
|
container_name: login-integration-debug
|
||||||
extends:
|
extends:
|
||||||
file: ../base/docker-compose.yml
|
file: ../login-integration/docker-compose.yaml
|
||||||
service: devcontainer
|
service: devcontainer
|
@@ -1,8 +1,9 @@
|
|||||||
{
|
{
|
||||||
"$schema": "https://raw.githubusercontent.com/devcontainers/spec/refs/heads/main/schemas/devContainer.schema.json",
|
"$schema": "https://raw.githubusercontent.com/devcontainers/spec/refs/heads/main/schemas/devContainer.schema.json",
|
||||||
"name": "login-integration",
|
"name": "Login Integration One-Off Container - Reproduce Pull Request Checks",
|
||||||
"dockerComposeFile": [
|
"dockerComposeFile": [
|
||||||
"../base/docker-compose.yml"
|
"../base/docker-compose.yaml",
|
||||||
|
"./docker-compose.yaml"
|
||||||
],
|
],
|
||||||
"service": "devcontainer",
|
"service": "devcontainer",
|
||||||
"runServices": [
|
"runServices": [
|
||||||
@@ -10,8 +11,10 @@
|
|||||||
],
|
],
|
||||||
"workspaceFolder": "/workspaces",
|
"workspaceFolder": "/workspaces",
|
||||||
"forwardPorts": [
|
"forwardPorts": [
|
||||||
|
22220,
|
||||||
|
22222,
|
||||||
3001
|
3001
|
||||||
],
|
],
|
||||||
"onCreateCommand": "pnpm install --frozen-lockfile --filter . --filter @zitadel/login; cd apps/login; pnpm cypress install",
|
"onCreateCommand": "pnpm --filter @zitadel/login install --frozen-lockfile; pnpm --filter @zitadel/login exec cypress install",
|
||||||
"postAttachCommand": "cd apps/login; pnpm test:integration:login"
|
"updateContentCommand": "pnpm --filter @zitadel/login test:integration:login"
|
||||||
}
|
}
|
27
.devcontainer/login-integration/docker-compose.yaml
Normal file
27
.devcontainer/login-integration/docker-compose.yaml
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
services:
|
||||||
|
devcontainer:
|
||||||
|
container_name: devcontainer-login-integration
|
||||||
|
env_file: ../../apps/login/.env.test
|
||||||
|
network_mode: service:mock-zitadel
|
||||||
|
|
||||||
|
login-integration:
|
||||||
|
container_name: login-integration
|
||||||
|
build:
|
||||||
|
context: ../..
|
||||||
|
dockerfile: build/login/Dockerfile
|
||||||
|
image: "${LOGIN_TAG:-zitadel-login:local}"
|
||||||
|
env_file: ../../apps/login/.env.test
|
||||||
|
network_mode: service:mock-zitadel
|
||||||
|
environment:
|
||||||
|
NODE_ENV: test
|
||||||
|
PORT: 3001
|
||||||
|
NEXT_PUBLIC_BASE_PATH: /ui/v2/login
|
||||||
|
|
||||||
|
mock-zitadel:
|
||||||
|
container_name: mock-zitadel
|
||||||
|
build:
|
||||||
|
context: ../../apps/login/integration/core-mock
|
||||||
|
ports:
|
||||||
|
- 22220:22220
|
||||||
|
- 22222:22222
|
||||||
|
- 3001:3001
|
22
.devcontainer/login-subtree/devcontainer.json
Normal file
22
.devcontainer/login-subtree/devcontainer.json
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
{
|
||||||
|
"$schema": "https://raw.githubusercontent.com/devcontainers/spec/refs/heads/main/schemas/devContainer.base.schema.json",
|
||||||
|
"image": "mcr.microsoft.com/devcontainers/typescript-node:20-bookworm",
|
||||||
|
"name": "Login Subtree Container - Use the Login As If You Would Have Forked the Mirror Repo",
|
||||||
|
"workspaceFolder": "/login",
|
||||||
|
"workspaceMount": "source=${localWorkspaceFolder}/apps/login,target=/login,type=bind,consistency=cached",
|
||||||
|
"mounts": [],
|
||||||
|
"forwardPorts": [
|
||||||
|
22220,
|
||||||
|
22222,
|
||||||
|
3000,
|
||||||
|
3001
|
||||||
|
],
|
||||||
|
"features": {
|
||||||
|
"ghcr.io/devcontainers/features/go:1": {
|
||||||
|
"version": "1.24"
|
||||||
|
},
|
||||||
|
"ghcr.io/guiyomh/features/golangci-lint:0": {},
|
||||||
|
"ghcr.io/jungaretti/features/make:1": {},
|
||||||
|
"ghcr.io/devcontainers/features/docker-outside-of-docker": {}
|
||||||
|
}
|
||||||
|
}
|
@@ -1,9 +1,9 @@
|
|||||||
{
|
{
|
||||||
"$schema": "https://raw.githubusercontent.com/devcontainers/spec/refs/heads/main/schemas/devContainer.schema.json",
|
"$schema": "https://raw.githubusercontent.com/devcontainers/spec/refs/heads/main/schemas/devContainer.schema.json",
|
||||||
"name": "turbo-lint-unit-debug",
|
"name": "Turbo Lint and Unit Hot Reload Container - Debug and Fix Pull Request Checks",
|
||||||
"dockerComposeFile": [
|
"dockerComposeFile": [
|
||||||
"../base/docker-compose.yml",
|
"../base/docker-compose.yaml",
|
||||||
"docker-compose.yml"
|
"docker-compose.yaml"
|
||||||
],
|
],
|
||||||
"service": "turbo-lint-unit-debug",
|
"service": "turbo-lint-unit-debug",
|
||||||
"runServices": [
|
"runServices": [
|
||||||
@@ -14,5 +14,8 @@
|
|||||||
3001
|
3001
|
||||||
],
|
],
|
||||||
"onCreateCommand": "pnpm install --recursive",
|
"onCreateCommand": "pnpm install --recursive",
|
||||||
"postAttachCommand": "pnpm turbo daemon clean || true; pnpm turbo watch lint test:unit"
|
"postAttachCommand": "pnpm turbo daemon clean || true; pnpm turbo watch lint test:unit",
|
||||||
|
"features": {
|
||||||
|
"ghcr.io/devcontainers/features/docker-outside-of-docker": {}
|
||||||
|
}
|
||||||
}
|
}
|
@@ -1,6 +1,6 @@
|
|||||||
services:
|
services:
|
||||||
turbo-lint-unit-debug:
|
turbo-lint-unit-debug:
|
||||||
extends:
|
|
||||||
file: ../base/docker-compose.yml
|
|
||||||
service: devcontainer
|
|
||||||
container_name: turbo-lint-unit-debug
|
container_name: turbo-lint-unit-debug
|
||||||
|
extends:
|
||||||
|
file: ../base/docker-compose.yaml
|
||||||
|
service: devcontainer
|
@@ -1,8 +1,8 @@
|
|||||||
{
|
{
|
||||||
"$schema": "https://raw.githubusercontent.com/devcontainers/spec/refs/heads/main/schemas/devContainer.schema.json",
|
"$schema": "https://raw.githubusercontent.com/devcontainers/spec/refs/heads/main/schemas/devContainer.schema.json",
|
||||||
"name": "turbo-lint-unit",
|
"name": "Turbo Lint and Unit One-Off Container - Reproduce Pull Request Checks",
|
||||||
"dockerComposeFile": [
|
"dockerComposeFile": [
|
||||||
"../base/docker-compose.yml"
|
"../base/docker-compose.yaml"
|
||||||
],
|
],
|
||||||
"service": "devcontainer",
|
"service": "devcontainer",
|
||||||
"runServices": [
|
"runServices": [
|
||||||
@@ -10,5 +10,5 @@
|
|||||||
],
|
],
|
||||||
"workspaceFolder": "/workspaces",
|
"workspaceFolder": "/workspaces",
|
||||||
"onCreateCommand": "pnpm install --frozen-lockfile --recursive",
|
"onCreateCommand": "pnpm install --frozen-lockfile --recursive",
|
||||||
"postAttachCommand": "pnpm turbo lint test:unit"
|
"updateContentCommand": "pnpm turbo lint test:unit"
|
||||||
}
|
}
|
@@ -1,11 +1,14 @@
|
|||||||
|
|
||||||
# .git
|
# .git
|
||||||
.codecov
|
.codecov
|
||||||
.github
|
.github
|
||||||
.gitignore
|
.gitignore
|
||||||
.dockerignore
|
.dockerignore
|
||||||
**/Dockerfile
|
**/Dockerfile
|
||||||
/k8s/
|
**/node_modules
|
||||||
/node_modules/
|
**/.pnpm-store
|
||||||
|
**/.turbo
|
||||||
|
**/.next
|
||||||
/console/src/app/proto/generated/
|
/console/src/app/proto/generated/
|
||||||
/console/.angular
|
/console/.angular
|
||||||
/console/tmp/
|
/console/tmp/
|
||||||
@@ -24,5 +27,5 @@ console/.angular
|
|||||||
console/node_modules
|
console/node_modules
|
||||||
console/src/app/proto/generated/
|
console/src/app/proto/generated/
|
||||||
console/tmp/
|
console/tmp/
|
||||||
.vscode
|
build/*.Dockerfile
|
||||||
build/*.Dockerfile
|
|
||||||
|
@@ -1,4 +1,3 @@
|
|||||||
NEXT_PUBLIC_BASE_PATH="/ui/v2/login"
|
|
||||||
ZITADEL_API_URL=http://localhost:22222
|
ZITADEL_API_URL=http://localhost:22222
|
||||||
ZITADEL_SERVICE_USER_TOKEN="yolo"
|
ZITADEL_SERVICE_USER_TOKEN="yolo"
|
||||||
EMAIL_VERIFICATION=true
|
EMAIL_VERIFICATION=true
|
||||||
|
1
apps/login/.gitignore
vendored
1
apps/login/.gitignore
vendored
@@ -12,6 +12,5 @@ node_modules
|
|||||||
dist
|
dist
|
||||||
dist-ssr
|
dist-ssr
|
||||||
*.local
|
*.local
|
||||||
.env
|
|
||||||
.vscode
|
.vscode
|
||||||
/blob-report/
|
/blob-report/
|
||||||
|
@@ -3,21 +3,21 @@ FROM node:20-alpine AS base
|
|||||||
FROM base AS build
|
FROM base AS build
|
||||||
ENV PNPM_HOME="/pnpm"
|
ENV PNPM_HOME="/pnpm"
|
||||||
ENV PATH="$PNPM_HOME:$PATH"
|
ENV PATH="$PNPM_HOME:$PATH"
|
||||||
RUN corepack enable && COREPACK_ENABLE_DOWNLOAD_PROMPT=0 corepack prepare pnpm@9.1.2 --activate && \
|
RUN corepack enable && COREPACK_ENABLE_DOWNLOAD_PROMPT=0 corepack prepare pnpm@10.13.1 --activate && \
|
||||||
apk update && apk add --no-cache && \
|
apk update && \
|
||||||
rm -rf /var/cache/apk/*
|
rm -rf /var/cache/apk/*
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
COPY pnpm-lock.yaml ./
|
COPY pnpm-lock.yaml ./
|
||||||
RUN --mount=type=cache,id=pnpm,target=/root/.local/share/pnpm/store pnpm fetch --frozen-lockfile
|
RUN --mount=type=cache,id=pnpm,target=/root/.local/share/pnpm/store pnpm fetch --frozen-lockfile
|
||||||
COPY package.json ./
|
COPY package.json ./
|
||||||
RUN --mount=type=cache,id=pnpm,target=/root/.local/share/pnpm/store pnpm install --frozen-lockfile --prod
|
RUN --mount=type=cache,id=pnpm,target=/root/.local/share/pnpm/store pnpm install --frozen-lockfile
|
||||||
COPY . .
|
COPY . .
|
||||||
RUN pnpm build:login:standalone
|
RUN pnpm build:login:standalone
|
||||||
|
|
||||||
FROM scratch AS build-out
|
FROM scratch AS build-out
|
||||||
COPY --from=build /app/.next/standalone /
|
COPY --from=build /app/.next/standalone /
|
||||||
COPY --from=build /app/.next/static /.next/static
|
COPY --from=build /app/.next/static /.next/static
|
||||||
COPY --from=build /app/public /public
|
COPY public public
|
||||||
|
|
||||||
FROM base AS login-standalone
|
FROM base AS login-standalone
|
||||||
WORKDIR /runtime
|
WORKDIR /runtime
|
||||||
@@ -25,12 +25,13 @@ RUN addgroup --system --gid 1001 nodejs && \
|
|||||||
adduser --system --uid 1001 nextjs
|
adduser --system --uid 1001 nextjs
|
||||||
# If /.env-file/.env is mounted into the container, its variables are made available to the server before it starts up.
|
# If /.env-file/.env is mounted into the container, its variables are made available to the server before it starts up.
|
||||||
RUN mkdir -p /.env-file && touch /.env-file/.env && chown -R nextjs:nodejs /.env-file
|
RUN mkdir -p /.env-file && touch /.env-file/.env && chown -R nextjs:nodejs /.env-file
|
||||||
COPY ./scripts/ ./
|
COPY --chown=nextjs:nodejs ./scripts/ ./
|
||||||
COPY --chown=nextjs:nodejs --from=build-out / ./
|
COPY --chown=nextjs:nodejs --from=build-out / ./
|
||||||
USER nextjs
|
USER nextjs
|
||||||
ENV HOSTNAME="0.0.0.0"
|
ENV HOSTNAME="0.0.0.0" \
|
||||||
ENV PORT=3000
|
NEXT_PUBLIC_BASE_PATH="/ui/v2/login" \
|
||||||
|
PORT=3000
|
||||||
# TODO: Check healthy, not ready
|
# TODO: Check healthy, not ready
|
||||||
HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
|
HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
|
||||||
CMD ["/bin/sh", "-c", "node ./healthcheck.js http://localhost:${PORT}/ui/v2/login/healthy"]
|
CMD ["/bin/sh", "-c", "node /runtime/healthcheck.js http://localhost:${PORT}/ui/v2/login/healthy"]
|
||||||
ENTRYPOINT ["./entrypoint.sh"]
|
ENTRYPOINT ["/runtime/entrypoint.sh"]
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"packageManager": "pnpm@9.1.2+sha256.19c17528f9ca20bd442e4ca42f00f1b9808a9cb419383cd04ba32ef19322aba7",
|
"packageManager": "pnpm@10.13.1",
|
||||||
"name": "@zitadel/login",
|
"name": "@zitadel/login",
|
||||||
"private": true,
|
"private": true,
|
||||||
"type": "module",
|
"type": "module",
|
||||||
|
9151
apps/login/pnpm-lock.yaml
generated
Normal file
9151
apps/login/pnpm-lock.yaml
generated
Normal file
File diff suppressed because it is too large
Load Diff
@@ -1,47 +1,52 @@
|
|||||||
FROM node:20-alpine AS base
|
FROM node:20-alpine AS runtime
|
||||||
|
|
||||||
FROM base AS build
|
FROM runtime AS pnpm-base
|
||||||
|
RUN apk add --no-cache libc6-compat
|
||||||
ENV PNPM_HOME="/pnpm"
|
ENV PNPM_HOME="/pnpm"
|
||||||
ENV PATH="$PNPM_HOME:$PATH"
|
ENV PATH="$PNPM_HOME:$PATH"
|
||||||
RUN corepack enable && COREPACK_ENABLE_DOWNLOAD_PROMPT=0 corepack prepare pnpm@9.1.2 --activate && \
|
RUN corepack enable && corepack prepare pnpm@10.13.1 --activate
|
||||||
apk update && apk add --no-cache && \
|
RUN --mount=type=cache,id=pnpm,target=/pnpm/store \
|
||||||
rm -rf /var/cache/apk/*
|
pnpm add -g turbo@2.5.5
|
||||||
WORKDIR /app
|
|
||||||
COPY pnpm-lock.yaml pnpm-workspace.yaml ./
|
FROM pnpm-base AS pruner
|
||||||
RUN --mount=type=cache,id=pnpm,target=/root/.local/share/pnpm/store \
|
WORKDIR /prune
|
||||||
pnpm fetch --frozen-lockfile \
|
|
||||||
--filter @zitadel/login \
|
|
||||||
--filter @zitadel/client \
|
|
||||||
--filter @zitadel/proto
|
|
||||||
COPY package.json ./
|
|
||||||
COPY apps/login/package.json ./apps/login/package.json
|
|
||||||
COPY packages/zitadel-proto/package.json ./packages/zitadel-proto/package.json
|
|
||||||
COPY packages/zitadel-client/package.json ./packages/zitadel-client/package.json
|
|
||||||
RUN --mount=type=cache,id=pnpm,target=/root/.local/share/pnpm/store \
|
|
||||||
pnpm install --frozen-lockfile \
|
|
||||||
--filter @zitadel/login \
|
|
||||||
--filter @zitadel/client \
|
|
||||||
--filter @zitadel/proto
|
|
||||||
COPY . .
|
COPY . .
|
||||||
|
RUN pnpm turbo prune @zitadel/login @zitadel/client @zitadel/proto --docker
|
||||||
|
|
||||||
|
FROM pnpm-base AS installer
|
||||||
|
WORKDIR /install
|
||||||
|
COPY --from=pruner /prune/out/pnpm-lock.yaml ./
|
||||||
|
RUN --mount=type=cache,id=pnpm,target=/pnpm/store \
|
||||||
|
pnpm fetch --frozen-lockfile
|
||||||
|
COPY --from=pruner /prune/out/json/ .
|
||||||
|
RUN --mount=type=cache,id=pnpm,target=/pnpm/store \
|
||||||
|
pnpm install --frozen-lockfile --ignore-scripts
|
||||||
|
|
||||||
|
FROM pnpm-base AS builder
|
||||||
|
WORKDIR /build
|
||||||
|
COPY --from=installer /install/ .
|
||||||
|
COPY --from=pruner /prune/out/full/ .
|
||||||
|
COPY proto ./proto
|
||||||
RUN pnpm turbo build:login:standalone
|
RUN pnpm turbo build:login:standalone
|
||||||
|
|
||||||
FROM scratch AS build-out
|
FROM scratch AS build-out
|
||||||
COPY --from=build /app/apps/login/.next/standalone /
|
COPY --from=builder /build/apps/login/.next/standalone /
|
||||||
COPY --from=build /app/apps/login/.next/static /.next/static
|
COPY --from=builder /build/apps/login/.next/static /apps/login/.next/static
|
||||||
COPY --from=build /app/apps/login/public /public
|
COPY --from=builder /build/apps/login/public /apps/login/public
|
||||||
|
|
||||||
FROM base AS login-standalone
|
FROM runtime AS login-standalone
|
||||||
WORKDIR /runtime
|
WORKDIR /runtime
|
||||||
RUN addgroup --system --gid 1001 nodejs && \
|
RUN addgroup --system --gid 1001 nodejs && \
|
||||||
adduser --system --uid 1001 nextjs
|
adduser --system --uid 1001 nextjs
|
||||||
# If /.env-file/.env is mounted into the container, its variables are made available to the server before it starts up.
|
# If /.env-file/.env is mounted into the container, its variables are made available to the server before it starts up.
|
||||||
RUN mkdir -p /.env-file && touch /.env-file/.env && chown -R nextjs:nodejs /.env-file
|
RUN mkdir -p /.env-file && touch /.env-file/.env && chown -R nextjs:nodejs /.env-file
|
||||||
COPY apps/login/scripts ./
|
COPY --chown=nextjs:nodejs apps/login/scripts ./
|
||||||
COPY --chown=nextjs:nodejs --from=build-out . .
|
COPY --chown=nextjs:nodejs --from=build-out / ./
|
||||||
|
# Debug the final structure
|
||||||
USER nextjs
|
USER nextjs
|
||||||
ENV HOSTNAME="0.0.0.0"
|
ENV HOSTNAME="0.0.0.0"
|
||||||
ENV PORT=3000
|
ENV PORT=3000
|
||||||
# TODO: Check healthy, not ready
|
# TODO: Check healthy, not ready
|
||||||
HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
|
HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
|
||||||
CMD ["/bin/sh", "-c", "node ./healthcheck.js http://localhost:${PORT}/ui/v2/login/healthy"]
|
CMD ["/bin/sh", "-c", "node /runtime/healthcheck.js http://localhost:${PORT}/ui/v2/login/healthy"]
|
||||||
ENTRYPOINT ["./entrypoint.sh"]
|
ENTRYPOINT ["/runtime/entrypoint.sh"]
|
||||||
|
@@ -23,6 +23,7 @@
|
|||||||
!packages/zitadel-proto/turbo.json
|
!packages/zitadel-proto/turbo.json
|
||||||
|
|
||||||
!packages/zitadel-client/package.json
|
!packages/zitadel-client/package.json
|
||||||
|
!packages/zitadel-client/**/package.json
|
||||||
!packages/zitadel-client/src
|
!packages/zitadel-client/src
|
||||||
!packages/zitadel-client/tsconfig.json
|
!packages/zitadel-client/tsconfig.json
|
||||||
!packages/zitadel-client/tsup.config.ts
|
!packages/zitadel-client/tsup.config.ts
|
||||||
@@ -30,8 +31,7 @@
|
|||||||
|
|
||||||
!proto
|
!proto
|
||||||
|
|
||||||
*.md
|
**/*.md
|
||||||
*.png
|
**/node_modules
|
||||||
node_modules
|
**/*.test.ts
|
||||||
*.test.ts
|
**/*.test.tsx
|
||||||
*.test.tsx
|
|
||||||
|
@@ -93,4 +93,4 @@
|
|||||||
"prettier-plugin-organize-imports": "^4.1.0",
|
"prettier-plugin-organize-imports": "^4.1.0",
|
||||||
"typescript": "5.1"
|
"typescript": "5.1"
|
||||||
}
|
}
|
||||||
}
|
}
|
@@ -67,6 +67,5 @@
|
|||||||
"@docusaurus/module-type-aliases": "^3.8.1",
|
"@docusaurus/module-type-aliases": "^3.8.1",
|
||||||
"@docusaurus/types": "^3.8.1",
|
"@docusaurus/types": "^3.8.1",
|
||||||
"tailwindcss": "^3.2.4"
|
"tailwindcss": "^3.2.4"
|
||||||
},
|
}
|
||||||
"packageManager": "pnpm@9.1.2+sha256.19c17528f9ca20bd442e4ca42f00f1b9808a9cb419383cd04ba32ef19322aba7"
|
}
|
||||||
}
|
|
@@ -31,4 +31,4 @@
|
|||||||
"@types/node": "^22.3.0",
|
"@types/node": "^22.3.0",
|
||||||
"cypress": "^13.13.3"
|
"cypress": "^13.13.3"
|
||||||
}
|
}
|
||||||
}
|
}
|
16
package.json
16
package.json
@@ -1,13 +1,19 @@
|
|||||||
{
|
{
|
||||||
"packageManager": "pnpm@9.1.2+sha256.19c17528f9ca20bd442e4ca42f00f1b9808a9cb419383cd04ba32ef19322aba7",
|
"packageManager": "pnpm@10.13.1",
|
||||||
"private": true,
|
"private": true,
|
||||||
"name": "zitadel-monorepo",
|
"name": "zitadel-monorepo",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"generate": "turbo run generate",
|
"generate": "turbo run generate",
|
||||||
"changeset": "changeset",
|
"changeset": "changeset",
|
||||||
"devcontainer": "devcontainer",
|
"devcontainer": "devcontainer",
|
||||||
"devcontainer:lint-unit": "devcontainer up --config .devcontainer/turbo-lint-unit/devcontainer.json --workspace-folder .",
|
"devcontainer:lint-unit": "npm run devcontainer:lint-unit:build && npm run devcontainer:lint-unit:up",
|
||||||
"devcontainer:integration:login": "devcontainer up --config .devcontainer/login-integration/devcontainer.json --workspace-folder ."
|
"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:integration:login": "npm run devcontainer:integration:login:build && pnpm 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"
|
||||||
},
|
},
|
||||||
"pnpm": {
|
"pnpm": {
|
||||||
"overrides": {
|
"overrides": {
|
||||||
@@ -19,7 +25,7 @@
|
|||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@changesets/cli": "^2.29.5",
|
"@changesets/cli": "^2.29.5",
|
||||||
"@devcontainers/cli": "^0.80.0",
|
"@devcontainers/cli": "^0.80.0",
|
||||||
"turbo": "2.5.5",
|
"sass": "^1.64.1",
|
||||||
"sass": "^1.64.1"
|
"turbo": "2.5.5"
|
||||||
}
|
}
|
||||||
}
|
}
|
@@ -1,4 +1,5 @@
|
|||||||
{
|
{
|
||||||
|
"packageManager": "pnpm@10.13.1",
|
||||||
"name": "@zitadel/client",
|
"name": "@zitadel/client",
|
||||||
"version": "1.2.0",
|
"version": "1.2.0",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
@@ -92,4 +93,4 @@
|
|||||||
"typescript": "^5.8.3",
|
"typescript": "^5.8.3",
|
||||||
"vitest": "^2.0.0"
|
"vitest": "^2.0.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
@@ -1,4 +1,5 @@
|
|||||||
{
|
{
|
||||||
|
"packageManager": "pnpm@10.13.1",
|
||||||
"name": "@zitadel/proto",
|
"name": "@zitadel/proto",
|
||||||
"version": "1.2.0",
|
"version": "1.2.0",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
|
Reference in New Issue
Block a user