-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
57 lines (39 loc) · 1.14 KB
/
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
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
FROM debian:buster-slim as base
RUN apt update
RUN apt install -y \
openssl
# Setup the rust environment
FROM base as setup
RUN apt-get install -y \
build-essential \
curl \
libssl-dev \
pkg-config \
protobuf-compiler
RUN apt-get update
RUN curl https://sh.rustup.rs -sSf | sh -s -- --profile minimal --default-toolchain nightly -y
ENV PATH="/root/.cargo/bin:${PATH}"
RUN rustup update
RUN USER=root cargo new --bin app
WORKDIR /app
# Build the project
FROM setup as build
COPY ./Cargo.toml ./Cargo.toml
COPY ./Cargo.lock ./Cargo.lock
COPY ./migration ./migration
COPY ./entity ./entity
COPY ./services ./services
COPY ./protobuf ./protobuf
RUN cargo build --locked --release
RUN rm src/*.rs
COPY ./src ./src
RUN rm ./target/release/deps/homeval*
RUN cargo install --path .
# Runtime
FROM base as runtime
COPY --from=build /app/target/release/homeval .
# Container metadata
LABEL org.opencontainers.image.source=https://github.com/goval-community/homeval
LABEL org.opencontainers.image.description="Custom replit eval server implementation"
LABEL org.opencontainers.image.licenses="AGPL-3.0-only"
ENTRYPOINT [ "./homeval" ]