-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
32 lines (21 loc) · 808 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
32
ARG RUST_VERSION=1.75
FROM rust:${RUST_VERSION}-slim-bookworm AS build
WORKDIR /app
# Need dependencies for build
RUN apt-get update && apt-get install -y libopus-dev libssl-dev pkg-config && rm -rf /var/lib/apt/lists/*
RUN cargo init . --name discomfort-fm
COPY ./Cargo.lock ./Cargo.lock
COPY ./Cargo.toml ./Cargo.toml
# Build only dependencies
RUN cargo build --release
RUN rm src/*.rs
COPY ./src ./src
COPY ./migrations ./migrations
RUN rm ./target/release/deps/discomfort_fm*
RUN cargo build --release
FROM debian:bookworm-slim
WORKDIR /app
COPY --from=build /app/target/release/discomfort-fm .
COPY ./docker-run.sh .
RUN apt-get update && apt-get install --no-install-recommends -y openssl libopus0 libopusfile0 python3-full python3-pip && rm -rf /var/lib/apt/lists/*
CMD ["./docker-run.sh"]