Skip to content

Commit

Permalink
build client as part of docker image
Browse files Browse the repository at this point in the history
  • Loading branch information
sgratzl committed Apr 30, 2018
1 parent 2bfe79d commit f3e70b6
Show file tree
Hide file tree
Showing 6 changed files with 51 additions and 17 deletions.
20 changes: 17 additions & 3 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,18 @@
/client
/.github
node_modules
/client/ts/**/*.js
*.map
*.pyc
.idea
__pycache__
/model_api/data
/model_api/processing/.ipynb_checkpoints
tmp.txt
/client_dist
/client/dist
/client/.cache-loader
/data
/docs

# extras
/docs
/.github
/.circleci
17 changes: 9 additions & 8 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
*.css.map
node_modules
/client/ts/**/*.js
*.map
*.pyc
.idea
__pycache__
model_api/data
*.pyc
model_api/processing/.ipynb_checkpoints
/model_api/data
/model_api/processing/.ipynb_checkpoints
tmp.txt
client_dist
client/dist
client/.cache-loader
/data
/client_dist
/client/dist
/client/.cache-loader
/data
6 changes: 6 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,9 @@ VOLUME /data
CMD [ "source activate s2sv && python3 server.py --dir /data" ]

ADD . /ws/

# build client and clean up afterwards
RUN /bin/bash /ws/setup_client.sh &&\
conda uninstall --name s2sv --yes nodejs &&\
conda clean --all --yes &&\
rm -rf client ~/.npm /boot/.cache/pip ~/.cache/pip
10 changes: 7 additions & 3 deletions Dockerfile_base
Original file line number Diff line number Diff line change
@@ -1,16 +1,20 @@
FROM continuumio/miniconda3:4.4.10

RUN conda update --yes -n base conda
RUN conda update --yes -n base conda &&\
conda clean --all --yes

ADD ./environment.yml /tmp/
RUN conda env create -f /tmp/environment.yml && conda clean --all
RUN conda env create -f /tmp/environment.yml &&\
conda clean --all --yes &&\
rm -rf /boot/.cache/pip ~/.cache/pip

#RUN conda create --yes --name s2sv python=3.6 h5py numpy scikit-learn flask
#RUN conda install --name s2sv --yes -c conda-forge connexion python-annoy
#RUN conda install --name s2sv --yes -c pytorch pytorch==0.3.1 faiss-cpu

WORKDIR /tmp
ADD ./setup_onmt_custom.sh /tmp/
RUN /bin/bash /tmp/setup_onmt_custom.sh && rm -rf /tmp
RUN /bin/bash /tmp/setup_onmt_custom.sh &&\
rm -rf /tmp /boot/.cache/pip ~/.cache/pip

ENTRYPOINT [ "/bin/bash", "-c" ]
6 changes: 3 additions & 3 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
version: '3.0'
services:
server:
build:
context: '.'
#command: '"source activate s2sv && python3 server.py --dir /data"'
image: sgratzl/seq2seq-vis-base
working_dir: '/ws'
command: '"source activate s2sv && python3 server.py --dir /data"'
volumes:
- './data/0316-fakedates:/data'
- '.:/ws'
Expand Down
9 changes: 9 additions & 0 deletions setup_client.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/usr/bin/env bash

# Build client
conda install --name s2sv --yes -c conda-forge nodejs
source activate s2sv
cd client
npm install
npm run build
cd ..

0 comments on commit f3e70b6

Please sign in to comment.