-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
29 lines (20 loc) · 924 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
# -----------------
# Cargo Build Stage
# -----------------
FROM rustlang/rust:nightly as cargo-build
WORKDIR /app
RUN cargo install diesel_cli --no-default-features --features "postgres"
RUN curl https://raw.githubusercontent.com/vishnubob/wait-for-it/master/wait-for-it.sh -o /usr/local/bin/wait-for-it
RUN chmod +x /usr/local/bin/wait-for-it
COPY . .
RUN cargo install --features "production" --path . --verbose --locked
# -----------------
# Final Stage
# -----------------
FROM debian:stable-slim
RUN apt-get update && apt-get -y install ca-certificates libssl-dev libpq-dev && rm -rf /var/lib/apt/lists/*
COPY --from=cargo-build /usr/local/cargo/bin/rbot-discord /bin
COPY --from=cargo-build /usr/local/cargo/bin/diesel /bin
COPY --from=cargo-build /usr/local/bin/wait-for-it /bin/wait-for-it
COPY ./migrations migrations
CMD /bin/bash -c "wait-for-it ${DB_HOST}:5432 && diesel migration run && rbot-discord"