iching-broker-level1/Dockerfile
Christopher Hase 0c32957d7f
All checks were successful
ci / build (push) Successful in 1m3s
avoid CrashLoopBackOff by sleeping after sending E-Mail
2025-03-26 12:44:42 +01:00

30 lines
No EOL
620 B
Docker

# 1. Node.js Build-Stage
FROM node:20.18.1 AS build
WORKDIR /app
COPY package*.json ./
COPY . .
#RUN npm install
RUN npm install -g npm@11.2.0
RUN npx tsc # TypeScript Code kompilieren
# 2. Rust build-Stage
FROM rust:1.74.0 AS rust-build
RUN cargo install iching
# 3. Final node.js runtime-Stage
FROM node:20.18.1
WORKDIR /app
# 4. Copy previous builds
COPY --from=build /app .
COPY --from=rust-build /usr/local/cargo/bin/iching /usr/local/bin/iching
# 5. Run app
CMD ["npx", "ts-node", "broker.ts"]
#run indefinitely to avoid CrashLoopBackOff
#CMD exec /bin/bash -c "trap : TERM INT; sleep infinity & wait"