forked from theUpsider/faculty-bot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
39 lines (27 loc) · 1.04 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
32
33
34
35
36
37
38
39
FROM rust:1.79 as builder
ENV RUSTFLAGS="-C target-cpu=native"
WORKDIR /faculty_manager
RUN apt-get update && apt-get install -y cmake && apt-get clean
# This is a dummy build to get the dependencies cached.
COPY Cargo.toml Cargo.lock ./
RUN mkdir src && \
echo "// dummy file" > src/lib.rs && \
cargo build --release && \
rm -r src
# This is the actual build, copy in the rest of the sources
COPY . .
RUN cargo build --release
# Now make the runtime container
FROM debian:buster-slim
# install ca-certificates
RUN \
apt-get update && \
apt-get install ca-certificates -y
# Install graphics-/imagemagick
RUN apt-get update && apt-get upgrade -y && apt-get install -y graphicsmagick imagemagick ghostscript && rm -rf /var/lib/apt/lists/*
# allow ghostscript to convert pdf to png
RUN mv /etc/ImageMagick-6/policy.xml /etc/ImageMagick-6/policy.xml.off
COPY --from=builder /faculty_manager/target/release/faculty_manager /usr/local/bin/faculty_manager
# copy config and env files
COPY Cargo.lock /
CMD ["/usr/local/bin/faculty_manager"]