forked from async-graphql/graphgate
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile-standalone-demo
40 lines (35 loc) · 962 Bytes
/
Dockerfile-standalone-demo
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
FROM rust:1.73 as builder
RUN apt-get update && apt-get install -y libssl-dev
COPY . /tmp
WORKDIR /tmp
RUN cargo build --bins --examples --release
FROM ubuntu:22.04
RUN apt update && apt 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" ]