iching-broker-level2/Dockerfile

44 lines
952 B
Docker
Raw Normal View History

2025-03-25 13:35:24 +00:00
# 1. Node.js Build-Stage
2025-04-02 12:24:32 +00:00
FROM forgejo.edf-bootstrap.cx.fg1.ffm.osc.live/devfw-cicd/node:20.18.1 AS build
2025-03-25 08:54:22 +00:00
WORKDIR /app
COPY package*.json ./
2025-03-25 13:35:24 +00:00
COPY . .
2025-03-25 08:54:22 +00:00
2025-03-26 09:31:06 +00:00
#RUN npm install
RUN npm install -g npm@11.2.0
2025-04-04 09:48:30 +00:00
RUN npx tsc
### NEW ###
RUN npm install -g http-server
2025-04-07 14:19:04 +00:00
RUN npx tsc event.ts
RUN npx tsc broker.ts
2025-04-04 09:48:30 +00:00
2025-03-25 11:39:58 +00:00
2025-03-26 10:39:02 +00:00
# 2. Rust build-Stage
2025-04-02 12:24:32 +00:00
FROM forgejo.edf-bootstrap.cx.fg1.ffm.osc.live/devfw-cicd/rust:1.74.0 AS rust-build
2025-03-25 11:39:58 +00:00
RUN cargo install iching
2025-03-25 08:54:22 +00:00
2025-03-26 10:39:02 +00:00
# 3. Final node.js runtime-Stage
2025-04-02 12:24:32 +00:00
FROM forgejo.edf-bootstrap.cx.fg1.ffm.osc.live/devfw-cicd/node:20.18.1
2025-03-25 13:35:24 +00:00
WORKDIR /app
2025-03-25 08:54:22 +00:00
2025-03-26 10:39:02 +00:00
# 4. Copy previous builds
2025-03-25 13:35:24 +00:00
COPY --from=build /app .
2025-04-07 14:19:04 +00:00
#COPY --from=rust-build /usr/local/cargo/bin/iching /usr/local/bin/iching
COPY --from=rust-build /usr/local/cargo/bin /usr/local/bin
2025-03-25 08:54:22 +00:00
2025-03-26 10:39:02 +00:00
# 5. Run app
2025-04-04 09:48:30 +00:00
#CMD ["npx", "ts-node", "broker.ts"]
### NEW ###
#RUN npx ts-node event.ts
2025-03-26 10:39:02 +00:00
2025-04-04 09:48:30 +00:00
#CMD ["http-server", "."]
2025-04-07 14:19:04 +00:00
#CMD ["npx", "http-server", "iching", "-p", "8080"]
CMD ["npx", "http-server", "-p", "8080"]