-
-
Notifications
You must be signed in to change notification settings - Fork 151
/
Copy pathDockerfile
31 lines (26 loc) · 1.59 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
# Using the official cargo-chef image
FROM lukemathwalker/cargo-chef:latest-rust-1.69.0 AS chef
WORKDIR /app
FROM chef AS planner
COPY . .
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 . .
RUN cargo build --release
# プロダクション用の Docker イメージをビルドする
FROM debian:bullseye AS production
COPY --from=builder /app/target/release/batch_update /usr/bin/batch_update
COPY --from=builder /app/target/release/crawl_all_submissions /usr/bin/crawl_all_submissions
COPY --from=builder /app/target/release/crawl_for_virtual_contests /usr/bin/crawl_for_virtual_contests
COPY --from=builder /app/target/release/crawl_from_new_contests /usr/bin/crawl_from_new_contests
COPY --from=builder /app/target/release/crawl_problems /usr/bin/crawl_problems
COPY --from=builder /app/target/release/crawl_recent_submissions /usr/bin/crawl_recent_submissions
COPY --from=builder /app/target/release/crawl_whole_contest /usr/bin/crawl_whole_contest
COPY --from=builder /app/target/release/delta_update /usr/bin/delta_update
COPY --from=builder /app/target/release/dump_json /usr/bin/dump_json
COPY --from=builder /app/target/release/fix_invalid_submissions /usr/bin/fix_invalid_submissions
COPY --from=builder /app/target/release/run_server /usr/bin/run_server
RUN apt-get update && apt-get install -y awscli postgresql-client
ADD ./scripts/sql-backup.sh /usr/bin/sql-backup.sh