-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathDockerfile
More file actions
37 lines (25 loc) · 816 Bytes
/
Dockerfile
File metadata and controls
37 lines (25 loc) · 816 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
34
35
36
37
############################
# STEP 1 build executable binary
############################
FROM rust:1-slim-buster as builder
ENV CODEDIR /app
COPY . ${CODEDIR}
WORKDIR ${CODEDIR}
RUN apt-get update && apt-get install -y build-essential libssl-dev pkg-config
RUN make release
############################
# STEP 2 build a small image
############################
FROM debian:buster-slim
RUN mkdir /app
WORKDIR /app
RUN apt-get update && apt-get install -y libssl-dev pkg-config
COPY --from=builder /app/mitm.rs /app/mitm.rs
COPY config/config.json /app/config.json
# Copy certs
COPY certs /app/
RUN groupadd -r appgroup && useradd -r -g appgroup appuser
RUN mkdir -p /home/appuser && chown -R appuser /home/appuser
USER appuser
EXPOSE 8080
CMD ["RUST_BACKTRACE=1 /app/mitm.rs --config /app/config.json"]