forked from reacherhq/check-if-email-exists
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
55 lines (36 loc) · 1.57 KB
/
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
43
44
45
46
47
48
49
50
51
52
53
54
55
# From https://shaneutt.com/blog/rust-fast-small-docker-image-builds/
# ------------------------------------------------------------------------------
# Cargo Build Stage
# ------------------------------------------------------------------------------
FROM messense/rust-musl-cross:x86_64-musl as cargo-build
WORKDIR /usr/src/reacher
RUN rm -f target/x86_64-unknown-linux-musl/release/deps/reacher*
COPY . .
ENV SQLX_OFFLINE=true
RUN cargo build --bin reacher_backend --release --target=x86_64-unknown-linux-musl
# ------------------------------------------------------------------------------
# Final Stage
# ------------------------------------------------------------------------------
FROM zenika/alpine-chrome
WORKDIR /home/reacher/
USER root
# Install chromedriver
# https://github.com/Zenika/alpine-chrome/blob/master/with-chromedriver/Dockerfile
RUN apk add --no-cache chromium-chromedriver
COPY --from=cargo-build /usr/src/reacher/target/x86_64-unknown-linux-musl/release/reacher_backend .
COPY --from=cargo-build /usr/src/reacher/docker.sh .
RUN chown chrome:chrome reacher_backend
RUN chown chrome:chrome docker.sh
# User chrome was created in zenika/alpine-chrome
USER chrome
ENV RUST_LOG=reacher=info
ENV RCH_HTTP_HOST=0.0.0.0
ENV PORT=8080
ENV RCH_HOTMAIL_USE_HEADLESS=http://localhost:9515
# Bulk verification is disabled by default. Set to 1 to enable it.
ENV RCH_ENABLE_BULK=0
EXPOSE 8080
# Remove entrypoint from parent Docker file
# https://stackoverflow.com/questions/40122152/how-to-remove-entrypoint-from-parent-image-on-dockerfile
ENTRYPOINT []
CMD ["./docker.sh"]