mirror of
https://github.com/zitadel/zitadel.git
synced 2025-08-11 12:47:35 +00:00
preview
This commit is contained in:
33
Dockerfile
Normal file
33
Dockerfile
Normal file
@@ -0,0 +1,33 @@
|
||||
FROM debian:latest AS artifact
|
||||
ENV ZITADEL_ARGS=
|
||||
ARG TARGETPLATFORM
|
||||
|
||||
RUN apt-get update && apt-get install ca-certificates -y
|
||||
|
||||
COPY entrypoint.sh /app/entrypoint.sh
|
||||
COPY zitadel /app/zitadel
|
||||
|
||||
RUN useradd -s "" --home / zitadel && \
|
||||
chown zitadel /app/zitadel && \
|
||||
chmod +x /app/zitadel && \
|
||||
chown zitadel /app/entrypoint.sh && \
|
||||
chmod +x /app/entrypoint.sh
|
||||
|
||||
WORKDIR /app
|
||||
ENV PATH="/app:${PATH}"
|
||||
|
||||
USER zitadel
|
||||
ENTRYPOINT ["/app/entrypoint.sh"]
|
||||
|
||||
FROM scratch AS final
|
||||
ARG TARGETPLATFORM
|
||||
|
||||
COPY --from=artifact /etc/passwd /etc/passwd
|
||||
COPY --from=artifact /etc/ssl/certs /etc/ssl/certs
|
||||
COPY --from=artifact /app/zitadel /app/zitadel
|
||||
|
||||
HEALTHCHECK NONE
|
||||
EXPOSE 8080
|
||||
|
||||
USER zitadel
|
||||
ENTRYPOINT ["/app/zitadel"]
|
11
apps/console/Dockerfile
Normal file
11
apps/console/Dockerfile
Normal file
@@ -0,0 +1,11 @@
|
||||
|
||||
FROM nginx:1.29.0
|
||||
RUN touch /var/run/nginx.pid && \
|
||||
chown -R nginx:nginx /var/cache/nginx /var/run/nginx.pid
|
||||
USER nginx
|
||||
COPY --chown=nginx:nginx nginx.conf /etc/nginx/nginx.conf
|
||||
# TODO Needs work to be configured for the console app
|
||||
COPY --chown=nginx:nginx dist/console /usr/share/nginx/html
|
||||
EXPOSE 3001
|
||||
ENTRYPOINT ["nginx", "-c", "/etc/nginx/nginx.conf"]
|
||||
CMD ["-g", "daemon off;"]
|
69
apps/console/nginx.conf
Normal file
69
apps/console/nginx.conf
Normal file
@@ -0,0 +1,69 @@
|
||||
worker_processes auto;
|
||||
|
||||
pid /tmp/nginx.pid;
|
||||
|
||||
events {
|
||||
worker_connections 1024;
|
||||
}
|
||||
|
||||
http {
|
||||
include /etc/nginx/mime.types;
|
||||
default_type application/octet-stream;
|
||||
|
||||
# Logging
|
||||
access_log off;
|
||||
error_log /dev/stderr warn;
|
||||
|
||||
# Performance
|
||||
sendfile on;
|
||||
tcp_nopush on;
|
||||
tcp_nodelay on;
|
||||
keepalive_timeout 65;
|
||||
keepalive_requests 1000;
|
||||
|
||||
# Compression
|
||||
gzip on;
|
||||
gzip_vary on;
|
||||
gzip_proxied any;
|
||||
gzip_min_length 256;
|
||||
gzip_comp_level 6;
|
||||
gzip_types
|
||||
text/plain
|
||||
text/css
|
||||
text/xml
|
||||
text/javascript
|
||||
application/javascript
|
||||
application/x-javascript
|
||||
application/json
|
||||
application/xml
|
||||
application/xml+rss
|
||||
font/ttf
|
||||
font/otf
|
||||
image/svg+xml;
|
||||
|
||||
server {
|
||||
listen 3001;
|
||||
server_name localhost;
|
||||
|
||||
root /usr/share/nginx/html;
|
||||
index index.html;
|
||||
|
||||
# Angular Routing
|
||||
location / {
|
||||
try_files $uri $uri/ /index.html;
|
||||
}
|
||||
|
||||
# Static Assets Caching
|
||||
location ~* \.(?:ico|css|js|gif|jpe?g|png|woff2?|eot|ttf|svg|map)$ {
|
||||
expires 1y;
|
||||
access_log off;
|
||||
add_header Cache-Control "public, immutable";
|
||||
}
|
||||
|
||||
# Optional: Explicit asset route
|
||||
location /assets/ {
|
||||
expires 1y;
|
||||
add_header Cache-Control "public, immutable";
|
||||
}
|
||||
}
|
||||
}
|
@@ -11,15 +11,15 @@
|
||||
"lint:check:prettier": "prettier --check src",
|
||||
"lint:fix": "prettier --write src",
|
||||
"generate": "pnpm exec buf generate ../../proto --include-imports --include-wkt",
|
||||
"clean": "rm -rf dist .angular .turbo node_modules src/app/proto/generated"
|
||||
"clean": "rm -rf dist .angular node_modules src/app/proto/generated"
|
||||
},
|
||||
"nx": {
|
||||
"targets": {
|
||||
"release": {
|
||||
"docker": {
|
||||
"repositoryName": "zitadel/console"
|
||||
}
|
||||
},
|
||||
"targets": {
|
||||
"generate": {
|
||||
"outputs": [
|
||||
"{projectRoot}/src/app/proto/generated/**"
|
||||
@@ -33,6 +33,17 @@
|
||||
"generate",
|
||||
"@zitadel/client:build"
|
||||
]
|
||||
},
|
||||
"docker:build": {
|
||||
"dependsOn": ["build"]
|
||||
},
|
||||
"docker:run": {
|
||||
"options": {
|
||||
"args": [
|
||||
"-p",
|
||||
"3001:3001"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
|
@@ -1,21 +0,0 @@
|
||||
*
|
||||
|
||||
!constants
|
||||
!scripts
|
||||
!src
|
||||
!public
|
||||
!locales
|
||||
!next.config.mjs
|
||||
!next-env-vars.d.ts
|
||||
!next-env.d.ts
|
||||
!tailwind.config.js
|
||||
!tsconfig.json
|
||||
!package.json
|
||||
!pnpm-lock.yaml
|
||||
|
||||
**/*.md
|
||||
**/*.png
|
||||
**/node_modules
|
||||
**/.turbo
|
||||
**/*.test.ts
|
||||
**/*.test.tsx
|
@@ -9,16 +9,15 @@ ENV NODE_ENV=production
|
||||
RUN addgroup --system --gid 1001 nodejs
|
||||
RUN adduser --system --uid 1001 nextjs
|
||||
|
||||
COPY public ./public
|
||||
COPY .next/standalone ./
|
||||
COPY .next/static ./.next/static
|
||||
RUN ls .next/static
|
||||
COPY --chown=nextjs:nodejs public ./public
|
||||
COPY --chown=nextjs:nodejs .next/standalone/ ./
|
||||
COPY --chown=nextjs:nodejs .next/static ./.next/static
|
||||
|
||||
USER nextjs
|
||||
|
||||
EXPOSE 3000
|
||||
EXPOSE 3002
|
||||
|
||||
ENV PORT=3000
|
||||
ENV PORT=3002
|
||||
|
||||
ENV HOSTNAME="0.0.0.0"
|
||||
CMD ["node", "server.js"]
|
||||
CMD ["node", "./apps/login/server.js"]
|
@@ -58,6 +58,19 @@
|
||||
"dependsOn": [
|
||||
"@zitadel/client#build"
|
||||
]
|
||||
},
|
||||
"docker:build": {
|
||||
"dependsOn": [
|
||||
"build:login:standalone"
|
||||
]
|
||||
},
|
||||
"docker:run": {
|
||||
"options": {
|
||||
"args": [
|
||||
"-p",
|
||||
"3002:3002"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
|
17
entrypoint.sh
Normal file
17
entrypoint.sh
Normal file
@@ -0,0 +1,17 @@
|
||||
#!/bin/bash
|
||||
|
||||
case $@ in
|
||||
sh*)
|
||||
${@:3}
|
||||
;;
|
||||
bash*)
|
||||
${@:5}
|
||||
;;
|
||||
*)
|
||||
if [[ ! -z "$@" ]]
|
||||
then
|
||||
ZITADEL_ARGS="$@"
|
||||
fi
|
||||
/app/zitadel ${ZITADEL_ARGS}
|
||||
;;
|
||||
esac
|
53
hodor/package.json
Normal file
53
hodor/package.json
Normal file
@@ -0,0 +1,53 @@
|
||||
{
|
||||
"packageManager": "pnpm@9.1.2+sha256.19c17528f9ca20bd442e4ca42f00f1b9808a9cb419383cd04ba32ef19322aba7",
|
||||
"private": true,
|
||||
"name": "@zitadel/api",
|
||||
"scripts": {
|
||||
"build": "make compile"
|
||||
},
|
||||
"nx": {
|
||||
"release": {
|
||||
"docker": {
|
||||
"repositoryName": "zitadel/zitadel"
|
||||
}
|
||||
},
|
||||
"targets": {
|
||||
"build": {
|
||||
"outputs": [
|
||||
"{workspaceRoot}/zitadel"
|
||||
],
|
||||
"dependsOn": [
|
||||
"@zitadel/console:build"
|
||||
]
|
||||
},
|
||||
"docker:build": {
|
||||
"dependsOn": [
|
||||
"build"
|
||||
]
|
||||
},
|
||||
"docker:run": {
|
||||
"options": {
|
||||
"args": [
|
||||
"-p",
|
||||
"3000:3000"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"pnpm": {
|
||||
"overrides": {
|
||||
"@typescript-eslint/parser": "^8.35.1",
|
||||
"@zitadel/client": "workspace:*",
|
||||
"@zitadel/proto": "workspace:*"
|
||||
}
|
||||
},
|
||||
"devDependencies": {
|
||||
"@bufbuild/buf": "^1.55.1",
|
||||
"@changesets/cli": "^2.29.5",
|
||||
"@devcontainers/cli": "^0.80.0",
|
||||
"@nx/docker": "21.4.0-beta.5",
|
||||
"nx": "21.4.0-beta.5",
|
||||
"sass": "1.64.1"
|
||||
}
|
||||
}
|
2
nx.json
2
nx.json
@@ -4,7 +4,7 @@
|
||||
"releaseTagPattern": "release/{projectName}/{version}",
|
||||
"groups": {
|
||||
"test": {
|
||||
"projects": ["@zitadel/login", "@zitadel/console"],
|
||||
"projects": ["@zitadel/login", "@zitadel/console", "@zitadel/api"],
|
||||
"projectsRelationship": "fixed",
|
||||
"docker": {
|
||||
"skipVersionActions": true,
|
||||
|
24
package.json
24
package.json
@@ -6,6 +6,11 @@
|
||||
"build": "make compile"
|
||||
},
|
||||
"nx": {
|
||||
"release": {
|
||||
"docker": {
|
||||
"repositoryName": "zitadel/zitadel"
|
||||
}
|
||||
},
|
||||
"targets": {
|
||||
"build": {
|
||||
"outputs": [
|
||||
@@ -14,6 +19,25 @@
|
||||
"dependsOn": [
|
||||
"@zitadel/console:build"
|
||||
]
|
||||
},
|
||||
"docker:build": {
|
||||
"dependsOn": [
|
||||
"build"
|
||||
],
|
||||
"options": {
|
||||
"push": false,
|
||||
"tags": [
|
||||
"zitadel/zitadel:latest"
|
||||
]
|
||||
}
|
||||
},
|
||||
"docker:run": {
|
||||
"options": {
|
||||
"args": [
|
||||
"-p",
|
||||
"3000:3000"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
|
21
pnpm-lock.yaml
generated
21
pnpm-lock.yaml
generated
@@ -591,6 +591,27 @@ importers:
|
||||
specifier: ^13.13.3
|
||||
version: 13.17.0
|
||||
|
||||
hodor:
|
||||
devDependencies:
|
||||
'@bufbuild/buf':
|
||||
specifier: ^1.55.1
|
||||
version: 1.55.1
|
||||
'@changesets/cli':
|
||||
specifier: ^2.29.5
|
||||
version: 2.29.5
|
||||
'@devcontainers/cli':
|
||||
specifier: ^0.80.0
|
||||
version: 0.80.0
|
||||
'@nx/docker':
|
||||
specifier: 21.4.0-beta.5
|
||||
version: 21.4.0-beta.5(nx@21.4.0-beta.5(@swc/core@1.13.3))
|
||||
nx:
|
||||
specifier: 21.4.0-beta.5
|
||||
version: 21.4.0-beta.5(@swc/core@1.13.3)
|
||||
sass:
|
||||
specifier: 1.64.1
|
||||
version: 1.64.1
|
||||
|
||||
packages/zitadel-client:
|
||||
dependencies:
|
||||
'@bufbuild/protobuf':
|
||||
|
@@ -3,3 +3,4 @@ packages:
|
||||
- "e2e"
|
||||
- "packages/*"
|
||||
- "apps/*"
|
||||
- "hodor"
|
||||
|
Reference in New Issue
Block a user