-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
40 lines (29 loc) · 939 Bytes
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#
# Build the frontend.
#
FROM node:18 as dashboard-builder
WORKDIR /usr/src/app
COPY ui ./
RUN wget https://github.com/MaybeJustJames/zephyr/releases/download/v0.4.0/Linux.tar.gz && \
tar xzf Linux.tar.gz && \
chmod +x zephyr/zephyr && \
mv zephyr/zephyr /usr/local/bin
RUN yarn install
RUN yarn run bundle
FROM rust:1.65-buster as server-builder
WORKDIR /build
COPY Cargo.toml .
COPY Cargo.lock .
COPY sql sql/
COPY src src/
RUN cargo build --release
FROM debian:buster-slim
COPY --from=dashboard-builder /usr/src/app/dist /app/dist
COPY --from=server-builder /build/target/release/server /app/blind
COPY --from=server-builder /build/sql /app/sql
RUN apt-get update -qq -y && \
apt-get install --no-install-recommends -y ca-certificates libssl-dev upx && \
apt-get clean && \
rm -rf /var/lib/apt/lists/* && \
upx /app/blind
CMD ["/app/blind", "-s", "/app/dist"]