-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
51 lines (40 loc) · 1.11 KB
/
Dockerfile
File metadata and controls
51 lines (40 loc) · 1.11 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
#1 BUILD app
FROM rust:1.65 as build
RUN apt-get update && \
apt-get install -y cmake npm
WORKDIR /ripe
#1.1a crate mock crates
RUN USER=root cargo new --bin app
RUN USER=root cargo new --lib core
RUN USER=root cargo new --lib plugins/mock_compile_agent
#1.1b copy actual crate manifests
COPY Cargo.lock Cargo.lock
COPY Cargo.toml Cargo.toml
COPY ./app/Cargo.toml ./app/Cargo.toml
COPY ./core/Cargo.toml ./core/Cargo.toml
#1.1c cache dependencies
RUN cargo build --release
#1.2a copy actual sources
WORKDIR /ripe
RUN rm ./app/src/*.rs
RUN rm ./core/src/*.rs
COPY ./app ./app
COPY ./core ./core
#1.2b copy migrations
WORKDIR /ripe/app
COPY ./app/migrations ./migrations
#1.2c copy plugins
WORKDIR /ripe
COPY plugins ./plugins
#1.2c build app for release
RUN cargo build --all --release
#2 RUN
FROM debian:buster-slim
RUN apt-get update && apt-get install -y openssl libpq-dev
WORKDIR /app
COPY --from=build /ripe/target/release/ripe .
COPY --from=build /ripe/target/release/*.so ./plugins/
# COPY --from=build /ripe/target/release/*.wasm ./plugins/
COPY .env-docker .env
ENV RUST_BACKTRACE=full
CMD ["/app/ripe"]