Skip to content

Commit

Permalink
Created environment docker image
Browse files Browse the repository at this point in the history
  • Loading branch information
jsbroks committed Apr 5, 2019
1 parent e2fe385 commit 1df3eb9
Show file tree
Hide file tree
Showing 6 changed files with 47 additions and 32 deletions.
29 changes: 3 additions & 26 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ WORKDIR /workspace/
COPY ./client /workspace/client

RUN npm install -g --quiet \
@vue/[email protected] \
@vue/[email protected]
@vue/[email protected] \
@vue/[email protected]

COPY ./client/package* /workspace/

Expand All @@ -15,34 +15,11 @@ ENV NODE_PATH=/workspace/node_modules
WORKDIR /workspace/client
RUN npm run build

# Setup flask

FROM python:3.6
FROM jsbroks/coco-annotator:python-env

WORKDIR /workspace/

# Install python package dependices
COPY ./backend/ /workspace/
RUN pip install -r requirements.txt && \
pip install gunicorn[eventlet]==19.9.0 && \
pip install pycocotools

# Install maskrcnn
RUN git clone --single-branch --depth 1 https://github.com/matterport/Mask_RCNN.git /tmp/maskrcnn && \
cd /tmp/maskrcnn && \
pip install -r requirements.txt && \
python3 setup.py install

# Install DEXTR
RUN git clone --single --depth 1 https://github.com/jsbroks/dextr-keras.git /tmp/dextr && \
cd /tmp/dextr && \
pip install -r requirements.txt && \
python setup.py install

COPY ./.git /workspace/.git

# Create server
WORKDIR /workspace/
RUN python set_path.py

COPY --from=build-stage /workspace/client/dist /workspace/dist
Expand Down
25 changes: 25 additions & 0 deletions backend/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Backend environment docker image
FROM python:3.6

WORKDIR /workspace/

# Copy backend
COPY ./backend/requirements.txt /workspace/

# Install python package dependices
RUN pip install -r requirements.txt && \
pip install gunicorn[eventlet]==19.9.0 && \
pip install pycocotools

# Install maskrcnn
RUN git clone --single-branch --depth 1 https://github.com/matterport/Mask_RCNN.git /tmp/maskrcnn && \
cd /tmp/maskrcnn && \
pip install -r requirements.txt && \
python3 setup.py install

# Install DEXTR
RUN git clone --single --depth 1 https://github.com/jsbroks/dextr-keras.git /tmp/dextr && \
cd /tmp/dextr && \
pip install -r requirements.txt && \
python setup.py install

2 changes: 1 addition & 1 deletion backend/config/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class Config:
# spawned to replace it.
#
SWAGGER_UI_JSONEDITOR = True
DEBUG = os.getenv("DEBUG", False)
DEBUG = os.getenv("DEBUG", 'false').lower() == 'true'
PRELOAD = False

MAX_CONTENT_LENGTH = os.getenv("MAX_CONTENT_LENGTH", 1 * 1024 * 1024 * 1024) # 1GB
Expand Down
16 changes: 16 additions & 0 deletions backend/webserver/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
FROM jsbroks/coco-annotator:python-env

WORKDIR /workspace/

# Install python package dependices
COPY ./backend/ /workspace/
COPY ./.git /workspace/.git
RUN python set_path.py

ENV FLASK_ENV=development
ENV DEBUG=true

EXPOSE 5000
CMD gunicorn -c webserver/gunicorn_config.py webserver:app --no-sendfile


2 changes: 1 addition & 1 deletion backend/webserver/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ def create_app():
@app.route('/', defaults={'path': ''})
@app.route('/<path:path>')
def index(path):

if app.debug:
return requests.get('http://frontend:8080/{}'.format(path)).text

Expand Down
5 changes: 1 addition & 4 deletions backend/workers/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
FROM python:3.6
FROM jsbroks/coco-annotator:python-env

WORKDIR /workspace/

# Install python package dependices
COPY ./backend/ /workspace/
COPY ./.git /workspace/.git

RUN pip install -r requirements.txt

EXPOSE 5555
CMD celery -A workers worker -l info

0 comments on commit 1df3eb9

Please sign in to comment.