This commit is contained in:
Florian Forster
2025-08-05 14:40:53 -07:00
parent 3e437575c2
commit 4ad22ba456
11 changed files with 151 additions and 165 deletions

31
apps/api/Dockerfile Normal file
View File

@@ -0,0 +1,31 @@
FROM debian:latest AS artifact
ENV ZITADEL_ARGS=
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
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"]

17
apps/api/entrypoint.sh Normal file
View File

@@ -0,0 +1,17 @@
#!/bin/bash
case $@ in
sh*)
${@:3}
;;
bash*)
${@:5}
;;
*)
if [[ ! -z "$@" ]]
then
ZITADEL_ARGS="$@"
fi
/app/zitadel ${ZITADEL_ARGS}
;;
esac

41
apps/api/project.json Normal file
View File

@@ -0,0 +1,41 @@
{
"name": "@zitadel/api",
"$schema": "node_modules/nx/schemas/project-schema.json",
"sourceRoot": ".",
"projectType": "application",
"release": {
"docker": {
"repositoryName": "zitadel/api"
}
},
"targets": {
"build": {
"command": "make compile",
"options": {
"command": "make compile"
},
"outputs": [
"{workspaceRoot}/apps/api/zitadel"
],
"dependsOn": [
"@zitadel/console:build"
]
},
"docker:build": {
"dependsOn": [
"build"
],
"images": [
"zitadel/zitadel:latest"
]
},
"docker:run": {
"options": {
"args": [
"-p",
"3000:3000"
]
}
}
}
}