iching-broker-level3/Dockerfile

33 lines
830 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-04-09 14:12:34 +00:00
COPY . .
2025-03-25 08:54:22 +00:00
2025-03-26 09:31:06 +00:00
RUN npm install -g npm@11.2.0
2025-04-09 14:12:34 +00:00
RUN npm install
2025-03-25 11:39:58 +00:00
2025-04-09 14:12:34 +00:00
RUN npx tsc -p tsconfig.json
2025-04-09 13:47:06 +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-04-09 14:12:34 +00:00
# 3. Final runtime
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-04-09 14:12:34 +00:00
COPY --from=build /app/dist ./dist
2025-04-09 14:33:40 +00:00
#COPY --from=build /app/index.html ./dist/iching/
COPY --from=build /app/index.html ./dist/
2025-04-07 14:31:26 +00:00
COPY --from=rust-build /usr/local/cargo/bin/iching /usr/local/bin/iching
2025-04-08 08:48:46 +00:00
RUN mkdir -p dist/iching
RUN cp dist/*.js dist/iching/
2025-04-10 06:57:08 +00:00
RUN node server.js
2025-04-09 14:12:34 +00:00
CMD ["npx", "http-server", "dist", "-p", "8080", "--mime", "application/javascript=js"]