31 lines
No EOL
810 B
Docker
31 lines
No EOL
810 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 -g npm@11.2.0
|
|
RUN npm install
|
|
|
|
RUN npx tsc -p tsconfig.json
|
|
|
|
# 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 runtime
|
|
FROM forgejo.edf-bootstrap.cx.fg1.ffm.osc.live/devfw-cicd/node:20.18.1
|
|
|
|
WORKDIR /app
|
|
|
|
COPY --from=build /app/dist ./dist
|
|
#COPY --from=build /app/index.html ./dist/iching/
|
|
COPY --from=build /app/index.html ./dist/
|
|
COPY --from=rust-build /usr/local/cargo/bin/iching /usr/local/bin/iching
|
|
|
|
RUN mkdir -p dist/iching
|
|
RUN cp dist/*.js dist/iching/
|
|
|
|
CMD ["npx", "http-server", "dist", "-p", "8080", "--mime", "application/javascript=js"] |