forked from SamTV12345/PodFetch
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile_armv7
50 lines (35 loc) · 1.26 KB
/
Dockerfile_armv7
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
# syntax = docker/dockerfile:experimental
FROM library/node:lts-bullseye as ui-builder
WORKDIR /app
COPY ./ui/ ./
RUN npm install && npm run build
FROM docker-registry.schwanzer.online/dockerhub_proxy/snowgoons/rustbuilder:rustc-1.69.0 as builder
USER root
WORKDIR /app/src
#ENV CARGO_NET_GIT_FETCH_WITH_CLI=true
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 build.rs .
ADD .git .
ADD db ./db
RUN rustup target add armv7-unknown-linux-musleabihf
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/ubuntu:latest AS Runtime
WORKDIR /app/
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"]