|
@@ -5,23 +5,10 @@
|
|
|
# Build image #
|
|
|
#################
|
|
|
|
|
|
-FROM ubuntu:bionic AS build
|
|
|
+FROM rust:1.42 AS build
|
|
|
|
|
|
-RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y \
|
|
|
- --no-install-recommends \
|
|
|
- ca-certificates \
|
|
|
- curl \
|
|
|
- gcc g++ \
|
|
|
- pkg-config \
|
|
|
- libssl-dev
|
|
|
-
|
|
|
-RUN curl https://static.rust-lang.org/rustup/dist/x86_64-unknown-linux-gnu/rustup-init >/tmp/rustup-init && \
|
|
|
- chmod +x /tmp/rustup-init && \
|
|
|
- /tmp/rustup-init -y --no-modify-path --default-toolchain stable --profile minimal
|
|
|
-ENV PATH=/root/.cargo/bin:$PATH
|
|
|
-
|
|
|
-WORKDIR /tmp/source
|
|
|
-COPY . /tmp/source/
|
|
|
+COPY . .
|
|
|
+RUN cargo test --release --all
|
|
|
RUN cargo build --release
|
|
|
|
|
|
##################
|
|
@@ -33,6 +20,6 @@ FROM ubuntu:bionic AS binary
|
|
|
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y \
|
|
|
ca-certificates
|
|
|
|
|
|
-COPY --from=build /tmp/source/target/release/triagebot /usr/local/bin/
|
|
|
+COPY --from=build /target/release/triagebot /usr/local/bin/
|
|
|
ENV PORT=80
|
|
|
CMD triagebot
|