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