forked from SamTV12345/PodFetch
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile_arm64
65 lines (47 loc) · 1.62 KB
/
Dockerfile_arm64
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
# syntax = docker/dockerfile:experimental
FROM library/node:lts-bullseye as ui-builder
WORKDIR /app
COPY ./ui/ ./
RUN npm install && npm run build
FROM library/rust:alpine3.17 as dependency-cache
USER root
RUN apk add pkgconfig openssl-dev libc-dev git
WORKDIR /app/src
ENV CARGO_NET_GIT_FETCH_WITH_CLI=true
ADD Cargo.toml .
ADD dummy.rs ./src/main.rs
ADD build.rs .
RUN RUSTFLAGS='-C target-feature=-crt-static' cargo build --release
FROM library/rust:alpine3.17 as builder
USER root
WORKDIR /app/src
RUN apk add pkgconfig openssl-dev libc-dev git
#ENV CARGO_NET_GIT_FETCH_WITH_CLI=true
COPY --from=dependency-cache /usr/local/cargo /usr/local/cargo
COPY --from=dependency-cache /app/src/target/ /app/src/target/
RUN rm -rf /app/src/static/*||true
COPY --from=ui-builder /app/dist /app/src/static
RUN rm -rf /app/src/target/release/deps/podfetch*
RUN rm -rf /app/src/target/release/podfetch*
ADD Cargo.toml .
ADD static ./static
ADD migrations ./migrations
ADD src ./src
ADD .git .
ADD build.rs .
ADD db ./db
RUN --security=insecure mkdir -p /usr/local/cargo/registry/index && \
chmod 777 /usr/local/cargo/registry/index && \
mount -t tmpfs none /usr/local/cargo/registry/index && \
RUSTFLAGS='-C target-feature=-crt-static' cargo build --release
FROM library/alpine:3.17 AS Runtime
WORKDIR /app/
RUN apk add libgcc tzdata
ENV TZ=Europe/Berlin
COPY --from=builder /app/src/target/release/podfetch /app/podfetch
COPY --from=builder /app/src/migrations /app/migrations
COPY --from=builder /app/src/db /app/db
COPY --from=ui-builder /app/dist /app/static
COPY ./docs/default.jpg /app/static/default.jpg
EXPOSE 8000
CMD ["./podfetch"]