-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
30 lines (20 loc) · 947 Bytes
/
Dockerfile
File metadata and controls
30 lines (20 loc) · 947 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
FROM rust:alpine AS builder
WORKDIR /app
RUN apk add --no-cache build-base musl-dev pkgconfig
COPY rustpipe/Cargo.toml ./
COPY rustpipe/src ./src
RUN cargo build --release
FROM alpine:latest
RUN apk add --no-cache postfix lmdb ca-certificates dumb-init tzdata
RUN addgroup -g 1001 mailpipe \
&& adduser -D -H -s /sbin/nologin -u 1001 -G mailpipe mailpipe
COPY --from=builder /app/target/release/rustpipe /usr/local/bin/rustpipe
RUN chown mailpipe:mailpipe /usr/local/bin/rustpipe && chmod 0755 /usr/local/bin/rustpipe
COPY postfix/main.cf /etc/postfix/main.cf
COPY postfix/master.cf /etc/postfix/master.cf
COPY postfix/transport /etc/postfix/transport
RUN chown root:root /etc/postfix/main.cf /etc/postfix/master.cf /etc/postfix/transport \
&& chmod 0644 /etc/postfix/main.cf /etc/postfix/master.cf /etc/postfix/transport
COPY entrypoint.sh /entrypoint.sh
RUN chmod 0755 /entrypoint.sh
ENTRYPOINT ["dumb-init", "--", "/entrypoint.sh"]