-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
67 lines (46 loc) · 1.43 KB
/
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
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
66
67
FROM ubuntu:24.04 AS base
ARG DEBIAN_FRONTEND=noninteractive
ENV LANG=C.UTF-8
# ---
FROM base AS build
WORKDIR /build
RUN apt update && \
apt install -y --no-install-recommends \
ca-certificates curl git unzip build-essential
# ---
FROM build AS build-deps
COPY scripts/get-deps .
RUN ./get-deps
# ---
FROM build AS build-app
RUN apt update && \
apt install -y --no-install-recommends \
ca-certificates curl git build-essential pkg-config \
python3-dev libssl-dev libclang-dev libpango1.0-dev libcairo2-dev librsvg2-dev
RUN --mount=type=cache,target=/root/.rustup \
--mount=type=cache,target=/root/.cargo \
curl -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain none && \
~/.cargo/bin/rustup toolchain install nightly --profile minimal
COPY . .
RUN --mount=type=cache,target=/root/.rustup \
--mount=type=cache,target=/root/.cargo \
--mount=type=cache,target=target \
~/.cargo/bin/cargo build --release && \
mv target/release/riamu . && \
strip riamu
# ---
FROM base AS app
WORKDIR /app
ARG PIP_BREAK_SYSTEM_PACKAGES=1
ARG PIP_DISABLE_PIP_VERSION_CHECK=1
ARG PIP_NO_CACHE_DIR=1
RUN apt update && \
apt install -y --no-install-recommends \
python3 python3-pip python3-dev sqlite3 ffmpeg && \
pip3 install pipenv && \
apt autopurge -y python3-pip
COPY Pipfile* .
RUN pipenv install --deploy --system
COPY --from=build-deps /build/deps deps
COPY --from=build-app /build/riamu .
CMD ["./riamu"]