-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathDockerfile
38 lines (25 loc) · 945 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
33
34
35
36
37
38
FROM skyuoi/ourchat:alpine-base AS chef
WORKDIR /app
FROM chef AS planner
COPY server /app/server
COPY Cargo.toml /app/Cargo.toml
COPY Cargo.lock /app/Cargo.lock
RUN cargo chef prepare --recipe-path recipe.json
FROM chef AS builder
COPY --from=planner /app/recipe.json recipe.json
RUN cargo chef cook --release --recipe-path recipe.json
COPY server /app/server
COPY Cargo.toml /app/Cargo.toml
COPY Cargo.lock /app/Cargo.lock
COPY service /app/service
COPY .cargo /app/.cargo
RUN cargo build --release
FROM alpine:latest AS ourchat-server
COPY --from=builder /app/target/release/server /usr/local/bin/server
COPY docker/config /etc/ourchat
CMD ["server", "-c", "/etc/ourchat/ourchat.toml"]
FROM alpine:latest AS http-server
COPY --from=builder /app/target/release/http_server /usr/local/bin/http_server
COPY docker/config /etc/ourchat
COPY resource/logo.png /etc/resource/logo.png
CMD ["http_server", "-c", "/etc/ourchat/http.toml"]