-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
51 lines (36 loc) · 1.55 KB
/
Copy pathDockerfile
File metadata and controls
51 lines (36 loc) · 1.55 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
# syntax=docker/dockerfile:1
# Multi-stage build: compile rtbit with webui from source, output minimal scratch image.
FROM rust:alpine AS builder
RUN apk update && apk add clang lld npm pkgconf musl-dev openssl-dev openssl-libs-static curl git
COPY . /src/
WORKDIR /src/
ENV OPENSSL_STATIC=1
# Remove desktop workspace member (excluded by .dockerignore, needs glib)
RUN sed -i '/"desktop\/src-tauri"/d' Cargo.toml
RUN --mount=type=cache,target=/usr/local/cargo/git/db \
--mount=type=cache,target=/usr/local/cargo/registry/cache \
--mount=type=cache,target=/usr/local/cargo/registry/index \
cargo build --profile release-github && \
cp target/release-github/rtbit /bin/rtbit
# ---
FROM lscr.io/linuxserver/baseimage-alpine:3.21
LABEL org.opencontainers.image.source="https://github.com/TheDancingDeveloper-org/rustTorrent"
LABEL org.opencontainers.image.url="https://github.com/TheDancingDeveloper-org/rustTorrent"
LABEL org.opencontainers.image.title="rustTorrent"
LABEL org.opencontainers.image.description="A modern BitTorrent client written in Rust"
COPY --from=builder /bin/rtbit /bin/rtbit
COPY root/ /
RUN mkdir -p /home/rtbit/db /home/rtbit/cache /home/rtbit/downloads /home/rtbit/completed
WORKDIR /home/rtbit
ENV HOME=/home/rtbit
ENV XDG_DATA_HOME=/home/rtbit/db
ENV XDG_CACHE_HOME=/home/rtbit/cache
ENV RTBIT_HTTP_API_LISTEN_ADDR=0.0.0.0:3030
ENV RTBIT_LISTEN_PORT=4240
ENV RTBIT_DOWNLOAD_FOLDER=/home/rtbit/downloads
VOLUME /home/rtbit/db
VOLUME /home/rtbit/cache
VOLUME /home/rtbit/downloads
VOLUME /home/rtbit/completed
EXPOSE 3030
EXPOSE 4240