Update Dockerfile
Browse files- Dockerfile +14 -39
Dockerfile
CHANGED
@@ -1,45 +1,20 @@
|
|
1 |
-
|
2 |
-
|
3 |
-
############################################################################################
|
4 |
-
|
5 |
-
# Using the `rust-musl-builder` as base image, instead of
|
6 |
-
# the official Rust toolchain
|
7 |
-
FROM clux/muslrust:stable AS chef
|
8 |
-
USER root
|
9 |
-
RUN cargo install cargo-chef
|
10 |
WORKDIR /app
|
11 |
|
12 |
-
|
13 |
-
|
14 |
-
RUN
|
15 |
|
16 |
-
FROM
|
17 |
-
COPY --from=planner /app/recipe.json recipe.json
|
18 |
-
# Build dependencies - this is the caching Docker layer!
|
19 |
-
RUN cargo chef cook --release --target x86_64-unknown-linux-musl --recipe-path recipe.json
|
20 |
-
# Build application
|
21 |
-
COPY ./pentaract .
|
22 |
-
RUN cargo build --target x86_64-unknown-linux-musl --release
|
23 |
|
24 |
-
|
25 |
-
|
26 |
-
|
|
|
27 |
|
28 |
-
FROM node:21-slim AS ui
|
29 |
WORKDIR /app
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
RUN pnpm run build
|
35 |
-
|
36 |
-
############################################################################################
|
37 |
-
#### RUNNING
|
38 |
-
############################################################################################
|
39 |
-
|
40 |
-
# We do not need the Rust toolchain to run the binary!
|
41 |
-
FROM scratch AS runtime
|
42 |
-
COPY --from=builder /app/target/x86_64-unknown-linux-musl/release/pentaract /
|
43 |
-
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
|
44 |
-
COPY --from=ui /app/dist /ui
|
45 |
-
ENTRYPOINT ["/pentaract"]
|
|
|
1 |
+
FROM node:lts AS BUILD_IMAGE
|
2 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
WORKDIR /app
|
4 |
|
5 |
+
COPY . /app
|
6 |
+
|
7 |
+
RUN npm i --registry http://registry.npmmirror.com && npm run build
|
8 |
|
9 |
+
FROM node:lts-alpine
|
|
|
|
|
|
|
|
|
|
|
|
|
10 |
|
11 |
+
COPY --from=BUILD_IMAGE /app/configs ./configs
|
12 |
+
COPY --from=BUILD_IMAGE /app/package.json ./package.json
|
13 |
+
COPY --from=BUILD_IMAGE /app/dist ./dist
|
14 |
+
COPY --from=BUILD_IMAGE /app/node_modules ./node_modules
|
15 |
|
|
|
16 |
WORKDIR /app
|
17 |
+
|
18 |
+
EXPOSE 8000
|
19 |
+
|
20 |
+
CMD ["npm", "start"]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|