iching-broker-level3/old.Dockerfile

49 lines
1 KiB
Docker
Raw Normal View History

2025-04-09 14:12:34 +00:00
# 1. Node.js Build-Stage
FROM forgejo.edf-bootstrap.cx.fg1.ffm.osc.live/devfw-cicd/node:20.18.1 AS build
WORKDIR /app
COPY package*.json ./
COPY . .
RUN npm install -g npm@11.2.0
#RUN npx tsc
#RUN npx tsc -p tsconfig.json
#RUN npx tsc event.ts
#RUN npx tsc broker.ts
#RUN npx tsc server.ts
RUN npx tsc -p tsconfig.json
RUN cp index.html dist/
# 2. Rust build-Stage
FROM forgejo.edf-bootstrap.cx.fg1.ffm.osc.live/devfw-cicd/rust:1.74.0 AS rust-build
RUN cargo install iching
# 3. Final node.js runtime-Stage
FROM forgejo.edf-bootstrap.cx.fg1.ffm.osc.live/devfw-cicd/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
# Lege das /iching-Verzeichnis in dist an
RUN mkdir -p dist/iching
# Kopiere HTML und JS-Dateien hinein
RUN cp index.html dist/iching/
RUN cp dist/*.js dist/iching/
# 5. Run server & app
RUN node server.js
CMD ["npx", "http-server", "dist", "-p", "8080", "--mime", "application/javascript=js"]