forked from Tapalogi/tapa-micro-mailer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
42 lines (33 loc) · 967 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
39
40
41
42
# --------------- #
# Stage 1 - Build #
# --------------- #
## Context Transfer
FROM rust:1.50-buster as builder
RUN mkdir /app
WORKDIR /app
COPY . .
## Additional System Packages
RUN apt-get update && \
apt-get install -y --no-install-recommends \
libzstd-dev libsass-dev make cmake \
ninja-build yasm nasm libsasl2-dev \
ca-certificates && \
update-ca-certificates
## Package Caching
RUN cargo fetch
## Final Binary
RUN RUSTFLAGS="-C link-args=-s" cargo build --release
# --------------- #
# Stage 2 - Final #
# --------------- #
FROM debian:buster-slim
LABEL maintainer="Aditya Kresna <kresna@tapalogi.com>"
## Additional System Packages
RUN apt-get update && \
apt-get install -y --no-install-recommends ca-certificates tzdata && \
update-ca-certificates && \
rm -rf /var/lib/apt/lists/*
RUN mkdir /app
WORKDIR /app
COPY --from=builder /app/target/release/tapa-micro-mailer tapa-micro-mailer
CMD [ "./tapa-micro-mailer" ]