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 frontend app in Docker too
cherry.computer
3 years ago
0db73022
0c4ec0b0
+20
-7
2 changed files
expand all
collapse all
unified
split
.dockerignore
Dockerfile
+2
-4
.dockerignore
···
1
-
*
2
!frontend
3
frontend/node_modules
4
-
frontend/src
5
-
frontend/esbuild.js
6
-
frontend/tsconfig.json
7
!server
8
server/target
···
1
+
*/
2
!frontend
3
frontend/node_modules
4
+
frontend/build
0
0
5
!server
6
server/target
+18
-3
Dockerfile
···
1
-
FROM rust:1.61 as builder
0
0
0
0
0
0
0
0
0
0
2
3
WORKDIR /usr/src/myivo-server
4
COPY server .
···
10
11
RUN apt-get update && apt-get install -y openssl && rm -rf /var/lib/apt/lists/*
12
13
-
COPY frontend .
14
-
COPY --from=builder /usr/local/cargo/bin/myivo-server /usr/local/bin/myivo-server
0
0
0
0
0
15
16
EXPOSE 8080
17
···
1
+
FROM node:16 as build-js
2
+
3
+
WORKDIR /usr/src/myivo
4
+
5
+
COPY frontend/package*.json .
6
+
RUN npm install
7
+
8
+
COPY frontend .
9
+
RUN npm run build
10
+
11
+
FROM rust:1.61 as builder-rs
12
13
WORKDIR /usr/src/myivo-server
14
COPY server .
···
20
21
RUN apt-get update && apt-get install -y openssl && rm -rf /var/lib/apt/lists/*
22
23
+
WORKDIR /root
24
+
25
+
COPY --from=build-js /usr/src/myivo/index.html ./
26
+
COPY --from=build-js /usr/src/myivo/images ./images
27
+
COPY --from=build-js /usr/src/myivo/fonts ./fonts
28
+
COPY --from=build-js /usr/src/myivo/build ./build
29
+
COPY --from=builder-rs /usr/local/cargo/bin/myivo-server /usr/local/bin/
30
31
EXPOSE 8080
32