avoid CrashLoopBackOff
This commit is contained in:
parent
d2688a6b7b
commit
574ef51ebd
2 changed files with 13 additions and 19 deletions
20
Dockerfile
20
Dockerfile
|
@ -1,8 +1,6 @@
|
||||||
# 1. Node.js Build-Stage
|
# 1. Node.js Build-Stage
|
||||||
FROM node:20.18.1 AS build
|
FROM node:20.18.1 AS build
|
||||||
|
|
||||||
RUN echo "Stage 1 startet"
|
|
||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
COPY package*.json ./
|
COPY package*.json ./
|
||||||
|
@ -12,25 +10,21 @@ COPY . .
|
||||||
RUN npm install -g npm@11.2.0
|
RUN npm install -g npm@11.2.0
|
||||||
RUN npx tsc # TypeScript Code kompilieren
|
RUN npx tsc # TypeScript Code kompilieren
|
||||||
|
|
||||||
# 2. Rust Build-Stage
|
# 2. Rust build-Stage
|
||||||
|
|
||||||
RUN echo "Stage 2 startet"
|
|
||||||
|
|
||||||
FROM rust:1.74.0 AS rust-build
|
FROM rust:1.74.0 AS rust-build
|
||||||
RUN cargo install iching
|
RUN cargo install iching
|
||||||
|
|
||||||
# 3. Final Node.js Runtime-Stage
|
# 3. Final node.js runtime-Stage
|
||||||
FROM node:20.18.1
|
FROM node:20.18.1
|
||||||
|
|
||||||
RUN echo "Stage 3 startet"
|
|
||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
# 4 Copy previous builds
|
# 4. Copy previous builds
|
||||||
COPY --from=build /app .
|
COPY --from=build /app .
|
||||||
COPY --from=rust-build /usr/local/cargo/bin/iching /usr/local/bin/iching
|
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", "broker.ts"]
|
||||||
#CMD ["npx", "ts-node", "mailsender.ts"]
|
|
||||||
|
#run indefinitely to avoid CrashLoopBackOff
|
||||||
|
CMD exec /bin/bash -c "trap : TERM INT; sleep infinity & wait"
|
|
@ -19,15 +19,15 @@ spec:
|
||||||
httpGet:
|
httpGet:
|
||||||
path: /healthz
|
path: /healthz
|
||||||
port: 8080
|
port: 8080
|
||||||
initialDelaySeconds: 30
|
initialDelaySeconds: 40
|
||||||
periodSeconds: 15
|
periodSeconds: 25
|
||||||
timeoutSeconds: 5
|
timeoutSeconds: 15
|
||||||
failureThreshold: 3
|
failureThreshold: 3
|
||||||
readinessProbe:
|
readinessProbe:
|
||||||
httpGet:
|
httpGet:
|
||||||
path: /ready
|
path: /ready
|
||||||
port: 8080
|
port: 8080
|
||||||
initialDelaySeconds: 20
|
initialDelaySeconds: 30
|
||||||
periodSeconds: 10
|
periodSeconds: 20
|
||||||
timeoutSeconds: 3
|
timeoutSeconds: 13
|
||||||
successThreshold: 2
|
successThreshold: 2
|
||||||
|
|
Loading…
Reference in a new issue