-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile
More file actions
33 lines (26 loc) · 814 Bytes
/
Dockerfile
File metadata and controls
33 lines (26 loc) · 814 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
32
33
FROM docker.io/library/rust:1-trixie AS builder
WORKDIR /build
RUN apt-get update \
&& apt-get upgrade -y \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
COPY Cargo.toml Cargo.lock ./
# cargo needs a dummy src/lib.rs to compile the dependencies
RUN mkdir -p src \
&& touch src/lib.rs \
&& cargo build --release --locked \
&& rm -rf src
COPY . ./
RUN cargo build --release --locked --offline
FROM docker.io/library/debian:trixie-slim AS final
RUN apt-get update \
&& apt-get upgrade -y \
&& apt-get install -y git \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* /var/cache/* /var/log/*
WORKDIR /app
VOLUME /app/calendars
VOLUME /app/eventfiles
VOLUME /app/userconfig
COPY --from=builder /build/target/release/hawhh-calendarbot-parser /usr/local/bin/
ENTRYPOINT ["hawhh-calendarbot-parser"]