-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
58 lines (49 loc) · 1.43 KB
/
Dockerfile
File metadata and controls
58 lines (49 loc) · 1.43 KB
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
# Server build stage
FROM rust:1.90-trixie AS builder
RUN apt-get update && apt-get install -y \
cmake \
pkg-config \
build-essential \
libheif-dev \
nasm \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /usr/src/redseat-daemon
# Cache dependencies — only invalidated when Cargo.toml/lock/build.rs change
COPY Cargo.toml Cargo.lock build.rs ./
RUN mkdir -p src/daemon \
&& echo 'fn main() {}' > src/main.rs \
&& echo 'fn main() {}' > src/daemon/main.rs \
&& cargo build --release \
&& rm -rf target/release/deps/redseat* target/release/redseat*
# Copy real source and rebuild only your code
COPY src/ src/
RUN cargo build --release
# Run stage
FROM debian:trixie-slim
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update && apt-get install -y --no-install-recommends \
ca-certificates \
# Core libheif runtime from trixie
libheif1 \
# Decoding plugin(s) for HEIC/HEVC
libheif-plugin-libde265 \
libde265-0 \
libjpeg62-turbo \
libaom3 \
libdav1d7 \
libx265-215 \
libwebp7 \
libpng16-16t64 \
libtiff6 \
libzip5 \
libltdl7 \
libgomp1 \
ffmpeg \
&& rm -rf /var/lib/apt/lists/*
# Update library cache
RUN ldconfig
WORKDIR /app
COPY --from=builder /usr/src/redseat-daemon/target/release/redseat-rust /app/redseat-rust
COPY --from=builder /usr/src/redseat-daemon/target/release/redseat-daemon /app/redseat-daemon
EXPOSE 8080
CMD ["./redseat-daemon", "--docker"]