-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathDockerfile.x86
More file actions
31 lines (26 loc) · 803 Bytes
/
Dockerfile.x86
File metadata and controls
31 lines (26 loc) · 803 Bytes
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
FROM rust:1.85-alpine as builder
# Read https://github.com/AntoniosBarotsis/Rss2Email/wiki/1.-Home#deploying
#
# TLDR; run docker build with `--build-arg compile_flag="--features aws-lambda"`
# if you want to build for Lambda
ARG compile_flag=""
RUN apk add --no-cache musl-dev openssl-dev
WORKDIR /opt
RUN cargo new --bin rss2email
WORKDIR /opt/rss2email
COPY ./Cargo.lock ./Cargo.lock
COPY ./Cargo.toml ./Cargo.toml
ADD ./benches ./benches
RUN touch src/lib.rs
RUN cargo build --release $compile_flag
RUN rm ./src/*.rs
RUN rm ./target/release/deps/rss2email*
RUN rm ./target/release/deps/lib*
ADD ./src ./src
RUN cargo build --release $compile_flag
FROM scratch
WORKDIR /opt/rss2email
COPY --from=builder /opt/rss2email/target/release/rss2email .
COPY .env .
COPY feeds.txt .
CMD ["./rss2email"]