-
Notifications
You must be signed in to change notification settings - Fork 13
/
Dockerfile-client
40 lines (32 loc) · 1 KB
/
Dockerfile-client
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 codequest/grpc-ruby:latest
# Set up proto directory and copy the code there:
ENV PROTO_HOME=/fortune-proto
RUN mkdir $PROTO_HOME
ADD ./proto $PROTO_HOME
# Set up library directory and generate protos:
ENV LIB_HOME=/fortune-lib
RUN mkdir $LIB_HOME
RUN protoc -I $PROTO_HOME \
--ruby_out=$LIB_HOME \
--grpc_out=$LIB_HOME \
--plugin=protoc-gen-grpc=`which grpc_ruby_plugin` \
$PROTO_HOME/fortune.proto
# Set up app directory:
ENV APP_HOME=/fortune-client
RUN mkdir $APP_HOME
WORKDIR $APP_HOME
# Add a Gemfile before the rest of the code, for caching purposes:
ADD ./client/Gemfile* $APP_HOME/
RUN bundle install --jobs 10
# Add the rest of the client code:
ADD ./client $APP_HOME
# Clean up installation artifacts:
RUN rm -rf $GRPC_PATH
# Copy CA certificate and server credentials:
ENV KEY_HOME=/.keys
RUN mkdir $KEY_HOME
WORKDIR $KEY_HOME
ADD ./keys/client.crt $KEY_HOME/
ADD ./keys/client.key $KEY_HOME/
ADD ./keys/server.crt $KEY_HOME/
WORKDIR $APP_HOME