Skip to content

Commit

Permalink
frontend: Multiple stage builds
Browse files Browse the repository at this point in the history
Signed-off-by: YujiOshima <yuji.oshima0x3fd@gmail.com>
  • Loading branch information
YujiOshima committed Apr 9, 2018
1 parent 37747e3 commit c6e3589
Showing 1 changed file with 11 additions and 32 deletions.
43 changes: 11 additions & 32 deletions manager/modeldb/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,35 +1,14 @@
FROM node:latest

EXPOSE 3000

RUN apt-get update \
&& apt-get install -y \
g++ \
make \
wget \
git \
&& apt-get clean

WORKDIR /root

# Install Thrift 0.10.0
RUN wget -q http://archive.apache.org/dist/thrift/0.10.0/thrift-0.10.0.tar.gz && \
tar -xzf thrift-0.10.0.tar.gz && \
cd thrift-0.10.0 && \
./configure --without-python && \
make && \
ln -n ~/thrift-0.10.0/compiler/cpp/thrift /usr/local/bin/thrift

RUN cd / && git clone https://github.com/mitdbg/modeldb

FROM thrift:0.11 AS build-env
RUN apt-get update && apt-get install -y git
RUN git clone https://github.com/mitdbg/modeldb
ADD manager/modeldb/frontend /modeldb/frontend

WORKDIR /modeldb/frontend

RUN npm install

RUN mkdir -p './thrift' && \
thrift -r -out './thrift' -gen js:node '../thrift/ModelDB.thrift' && \
npm install
ENTRYPOINT ["/modeldb/dockerbuild/wait_for_backend.sh"]
CMD ["backend"]
thrift -r -out './thrift' -gen js:node '../thrift/ModelDB.thrift'

FROM node:alpine
COPY --from=build-env /modeldb /modeldb
WORKDIR /modeldb/frontend
RUN npm install
EXPOSE 3000
ENTRYPOINT ["sh","/modeldb/dockerbuild/wait_for_backend.sh"]

0 comments on commit c6e3589

Please sign in to comment.