diff --git a/Dockerfile b/Dockerfile index 2ab546e..99a7a86 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,8 +1,6 @@ # 1. Node.js Build-Stage FROM node:20.18.1 AS build -RUN echo "Stage 1 startet" - WORKDIR /app COPY package*.json ./ @@ -12,25 +10,21 @@ COPY . . RUN npm install -g npm@11.2.0 RUN npx tsc # TypeScript Code kompilieren -# 2. Rust Build-Stage - -RUN echo "Stage 2 startet" - +# 2. Rust build-Stage FROM rust:1.74.0 AS rust-build RUN cargo install iching -# 3. Final Node.js Runtime-Stage +# 3. Final node.js runtime-Stage FROM node:20.18.1 -RUN echo "Stage 3 startet" - WORKDIR /app -# 4 Copy previous builds +# 4. Copy previous builds COPY --from=build /app . COPY --from=rust-build /usr/local/cargo/bin/iching /usr/local/bin/iching -RUN echo "Calling Broker" - +# 5. Run app CMD ["npx", "ts-node", "broker.ts"] -#CMD ["npx", "ts-node", "mailsender.ts"] \ No newline at end of file + +#run indefinitely to avoid CrashLoopBackOff +CMD exec /bin/bash -c "trap : TERM INT; sleep infinity & wait" \ No newline at end of file diff --git a/deployment.yaml b/deployment.yaml index e70110a..540e0a3 100644 --- a/deployment.yaml +++ b/deployment.yaml @@ -19,15 +19,15 @@ spec: httpGet: path: /healthz port: 8080 - initialDelaySeconds: 30 - periodSeconds: 15 - timeoutSeconds: 5 + initialDelaySeconds: 40 + periodSeconds: 25 + timeoutSeconds: 15 failureThreshold: 3 readinessProbe: httpGet: path: /ready port: 8080 - initialDelaySeconds: 20 - periodSeconds: 10 - timeoutSeconds: 3 + initialDelaySeconds: 30 + periodSeconds: 20 + timeoutSeconds: 13 successThreshold: 2