-
Notifications
You must be signed in to change notification settings - Fork 8
/
Dockerfile
37 lines (28 loc) · 908 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
# Docker 17.05 or higher required for multi-stage builds
# NOTE: this builds w/ a nightly version (specified in rust-toolchain)
FROM rust:1.72-buster as builder
ADD . /app
WORKDIR /app
RUN \
apt-get -qq update && \
apt-get -qq install -y default-libmysqlclient-dev libssl-dev && \
\
cargo --version && \
rustc --version && \
cargo install --path . --locked --root /app
FROM debian:buster-slim
RUN \
groupadd --gid 10001 app && \
useradd --uid 10001 --gid 10001 --home /app --create-home app && \
\
apt-get -qq update && \
apt-get -qq install -y default-libmysqlclient-dev libssl-dev libcurl4 && \
rm -rf /var/lib/apt/lists
COPY --from=builder /app/bin /app/bin
COPY --from=builder /app/version.json /app
WORKDIR /app
USER app
# override rocket's dev env defaulting to localhost
ENV ROCKET_ADDRESS 0.0.0.0
ENV ROCKET_LOG off
CMD ["/app/bin/megaphone"]