2018-06-27 00:50:40 +03:00
|
|
|
# Docker 17.05 or higher required for multi-stage builds
|
|
|
|
FROM rust:1.26.0-stretch as builder
|
|
|
|
ADD . /app
|
|
|
|
WORKDIR /app
|
|
|
|
RUN \
|
|
|
|
apt-get -qq update && \
|
|
|
|
apt-get -qq install -y default-libmysqlclient-dev && \
|
|
|
|
\
|
|
|
|
cargo --version && \
|
|
|
|
rustc --version && \
|
|
|
|
mkdir -m 755 bin && \
|
|
|
|
mkdir -m 755 bin/config && \
|
|
|
|
cargo build --release && \
|
|
|
|
cp -R /app/config/* /app/bin/config && \
|
2018-07-03 20:13:43 +03:00
|
|
|
cp /app/target/release/fxa_email_send /app/bin && \
|
|
|
|
cp /app/target/release/fxa_email_queues /app/bin
|
2018-07-14 15:04:30 +03:00
|
|
|
COPY version.json /app
|
2018-06-27 00:50:40 +03:00
|
|
|
|
|
|
|
|
|
|
|
FROM debian:stretch-slim
|
|
|
|
# FROM debian:stretch # for debugging docker build
|
|
|
|
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 ca-certificates && \
|
|
|
|
update-ca-certificates && \
|
|
|
|
rm -rf /var/lib/apt/lists
|
|
|
|
|
2018-07-14 15:04:30 +03:00
|
|
|
COPY --from=builder /app/version.json /app/version.json
|
2018-06-27 00:50:40 +03:00
|
|
|
COPY --from=builder /app/bin /app/bin
|
|
|
|
|
|
|
|
WORKDIR /app/bin
|
|
|
|
USER app
|
|
|
|
|
2018-07-26 03:50:32 +03:00
|
|
|
ENV FXA_EMAIL_ENV production
|
2018-06-27 23:07:57 +03:00
|
|
|
ENV ROCKET_ENV production
|
|
|
|
|
2018-07-03 20:13:43 +03:00
|
|
|
CMD ["/app/bin/fxa_email_send"]
|