tangled
alpha
login
or
join now
cherry.computer
/
website
My personal site
cherry.computer
htmx
tailwind
axum
askama
0
fork
atom
overview
issues
pulls
pipelines
Build production versions of components in Docker
cherry.computer
3 years ago
a9fefab2
0db73022
+4
-2
1 changed file
expand all
collapse all
unified
split
Dockerfile
+4
-2
Dockerfile
···
6
6
RUN npm install
7
7
8
8
COPY frontend .
9
9
-
RUN npm run build
9
9
+
RUN npm run build:production
10
10
11
11
FROM rust:1.61 as builder-rs
12
12
13
13
WORKDIR /usr/src/myivo-server
14
14
COPY server .
15
15
16
16
-
RUN cargo install --path .
16
16
+
RUN cargo install --profile release --locked --path .
17
17
18
18
# run on different image
19
19
FROM debian:buster-slim
···
23
23
WORKDIR /root
24
24
25
25
COPY --from=build-js /usr/src/myivo/index.html ./
26
26
+
# point to minimised, production versions of build artefacts
27
27
+
RUN sed -i "s|build/app|build/app.min|g" index.html
26
28
COPY --from=build-js /usr/src/myivo/images ./images
27
29
COPY --from=build-js /usr/src/myivo/fonts ./fonts
28
30
COPY --from=build-js /usr/src/myivo/build ./build