FROM rust:1.50 as builder RUN apt-get update && apt-get install -y libssl-dev COPY . /tmp WORKDIR /tmp RUN cargo build --bins --examples --release FROM ubuntu:18.04 RUN apt-get update && apt-get install -y libssl-dev COPY --from=builder /tmp/target/release/graphgate /usr/bin/graphgate COPY --from=builder /tmp/target/release/examples/accounts /usr/bin/accounts COPY --from=builder /tmp/target/release/examples/products /usr/bin/products COPY --from=builder /tmp/target/release/examples/reviews /usr/bin/reviews EXPOSE 8000 RUN echo "\n\ bind = \"0.0.0.0:8000\"\n\ \n\ [[services]]\n\ name = \"accounts\"\n\ addr = \"127.0.0.1:8001\"\n\ \n\ [[services]]\n\ name = \"products\"\n\ addr = \"127.0.0.1:8002\"\n\ \n\ [[services]]\n\ name = \"reviews\"\n\ addr = \"127.0.0.1:8003\"\n\ " > /etc/graphgate.conf RUN echo "\n\ accounts&\n\ products&\n\ reviews&\n\ sleep 1\n\ graphgate /etc/graphgate.conf\n\ " > /usr/bin/start.sh ENTRYPOINT [ "bash", "/usr/bin/start.sh" ]