iching-broker-level3/Dockerfile

50 lines
1.3 KiB
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 ###
2025-04-09 09:10:36 +00:00
#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-04-08 08:59:01 +00:00
RUN cp index.html dist/
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: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
# 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/
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
2025-04-08 07:59:33 +00:00
#CMD ["npx", "http-server", ".", "-p", "8080"]
2025-04-08 09:15:53 +00:00
#CMD ["npx", "http-server", "dist", "-p", "8080"]
2025-04-09 11:20:25 +00:00
#CMD ["npx", "http-server", "dist/iching", "-p", "8080", "--mime", "application/javascript=js"]
2025-04-09 09:49:58 +00:00
#CMD ["npx", "http-server", "dist/iching", "-p", "8080", "--mime", "application/javascript=js", "-S", "false"]
2025-04-09 11:20:25 +00:00
CMD ["npx", "http-server", "dist", "-p", "8080", "--mime", "application/javascript=js"]