fix docker image

This commit is contained in:
wait-what 2024-04-23 00:37:54 +03:00
parent 8d8b098d86
commit 7d2776584b
3 changed files with 844 additions and 148 deletions

980
january/Cargo.lock generated

File diff suppressed because it is too large Load diff

View file

@ -6,7 +6,7 @@ edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies] [dependencies]
actix-web = "4.0" actix-web = "4.4.1"
lazy_static = "1.4" lazy_static = "1.4"
imagesize = "0.8" imagesize = "0.8"
reqwest = "0.11" reqwest = "0.11"

View file

@ -1,17 +1,19 @@
# Build Stage # Build Stage
FROM rustlang/rust:nightly-slim AS builder FROM rustlang/rust:nightly-bullseye-slim AS builder
USER 0:0 USER 0:0
WORKDIR /home/rust/src WORKDIR /home/rust/src
RUN apt-get update && apt-get install -y libssl-dev pkg-config
RUN USER=root cargo new --bin january RUN USER=root cargo new --bin january
WORKDIR /home/rust/src/january WORKDIR /home/rust/src/january
COPY Cargo.toml Cargo.lock ./ COPY Cargo.toml Cargo.lock ./
COPY src ./src COPY src ./src
RUN apt-get update && apt-get install -y libssl-dev pkg-config && cargo install --locked --path . RUN cargo install --locked --path .
# Bundle Stage # Bundle Stage
FROM debian:buster-slim FROM debian:bullseye-slim
RUN apt-get update && apt-get install -y ca-certificates ffmpeg RUN apt-get update && apt-get install -y ca-certificates ffmpeg libssl-dev
COPY --from=builder /usr/local/cargo/bin/january ./ COPY --from=builder /usr/local/cargo/bin/january ./
EXPOSE 7000 EXPOSE 7000
ENV JANUARY_HOST 0.0.0.0:7000 ENV JANUARY_HOST 0.0.0.0:7000