iching-broker-level2/Dockerfile
Christopher Hase 0e0280f3ee
All checks were successful
ci / build (push) Successful in 1m22s
add http-server part 3.8
2025-04-07 16:42:25 +02:00

43 lines
952 B
Docker

# 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
RUN npm install -g npm@11.2.0
RUN npx tsc
### NEW ###
RUN npm install -g http-server
RUN npx tsc event.ts
RUN npx tsc broker.ts
# 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
#COPY --from=rust-build /usr/local/cargo/bin /usr/local/bin
# 5. Run app
#CMD ["npx", "ts-node", "broker.ts"]
### NEW ###
#RUN npx ts-node event.ts
#CMD ["http-server", "."]
CMD ["npx", "http-server", "iching", "-p", "8080"]
#CMD ["npx", "http-server", "-p", "8080"]