-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
31 lines (20 loc) · 895 Bytes
/
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
FROM docker.io/rustlang/rust:nightly-alpine as prepare
WORKDIR /app
COPY . .
RUN apk add --no-cache libc-dev musl-dev openssl-dev git sqlite-dev
RUN cargo install sqlx-cli --no-default-features --features rustls,sqlite
RUN sqlx migrate run
FROM docker.io/rustlang/rust:nightly-alpine as build
WORKDIR /app
COPY . .
COPY --from=prepare /app/db.sqlite .
RUN apk add --no-cache libc-dev musl-dev openssl-dev sqlite-dev
RUN cargo build --release
FROM docker.io/fedora
WORKDIR /app
RUN dnf install -y https://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm
RUN dnf install -y https://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm
RUN yum -y install libwebp-tools ffmpeg akmod-nvidia xorg-x11-drv-nvidia-cuda
COPY --from=build /app/target/release/media_hoster ./
EXPOSE 80
ENTRYPOINT ["./media_hoster"]