Skip to content

Commit 1df3eb9

Browse files
committed
Created environment docker image
1 parent e2fe385 commit 1df3eb9

File tree

6 files changed

+47
-32
lines changed

6 files changed

+47
-32
lines changed

Dockerfile

Lines changed: 3 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ WORKDIR /workspace/
44
COPY ./client /workspace/client
55

66
RUN npm install -g --quiet \
7-
8-
7+
8+
99

1010
COPY ./client/package* /workspace/
1111

@@ -15,34 +15,11 @@ ENV NODE_PATH=/workspace/node_modules
1515
WORKDIR /workspace/client
1616
RUN npm run build
1717

18-
# Setup flask
19-
20-
FROM python:3.6
18+
FROM jsbroks/coco-annotator:python-env
2119

2220
WORKDIR /workspace/
23-
24-
# Install python package dependices
2521
COPY ./backend/ /workspace/
26-
RUN pip install -r requirements.txt && \
27-
pip install gunicorn[eventlet]==19.9.0 && \
28-
pip install pycocotools
29-
30-
# Install maskrcnn
31-
RUN git clone --single-branch --depth 1 https://github.com/matterport/Mask_RCNN.git /tmp/maskrcnn && \
32-
cd /tmp/maskrcnn && \
33-
pip install -r requirements.txt && \
34-
python3 setup.py install
35-
36-
# Install DEXTR
37-
RUN git clone --single --depth 1 https://github.com/jsbroks/dextr-keras.git /tmp/dextr && \
38-
cd /tmp/dextr && \
39-
pip install -r requirements.txt && \
40-
python setup.py install
41-
4222
COPY ./.git /workspace/.git
43-
44-
# Create server
45-
WORKDIR /workspace/
4623
RUN python set_path.py
4724

4825
COPY --from=build-stage /workspace/client/dist /workspace/dist

backend/Dockerfile

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Backend environment docker image
2+
FROM python:3.6
3+
4+
WORKDIR /workspace/
5+
6+
# Copy backend
7+
COPY ./backend/requirements.txt /workspace/
8+
9+
# Install python package dependices
10+
RUN pip install -r requirements.txt && \
11+
pip install gunicorn[eventlet]==19.9.0 && \
12+
pip install pycocotools
13+
14+
# Install maskrcnn
15+
RUN git clone --single-branch --depth 1 https://github.com/matterport/Mask_RCNN.git /tmp/maskrcnn && \
16+
cd /tmp/maskrcnn && \
17+
pip install -r requirements.txt && \
18+
python3 setup.py install
19+
20+
# Install DEXTR
21+
RUN git clone --single --depth 1 https://github.com/jsbroks/dextr-keras.git /tmp/dextr && \
22+
cd /tmp/dextr && \
23+
pip install -r requirements.txt && \
24+
python setup.py install
25+

backend/config/config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ class Config:
3232
# spawned to replace it.
3333
#
3434
SWAGGER_UI_JSONEDITOR = True
35-
DEBUG = os.getenv("DEBUG", False)
35+
DEBUG = os.getenv("DEBUG", 'false').lower() == 'true'
3636
PRELOAD = False
3737

3838
MAX_CONTENT_LENGTH = os.getenv("MAX_CONTENT_LENGTH", 1 * 1024 * 1024 * 1024) # 1GB

backend/webserver/Dockerfile

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
FROM jsbroks/coco-annotator:python-env
2+
3+
WORKDIR /workspace/
4+
5+
# Install python package dependices
6+
COPY ./backend/ /workspace/
7+
COPY ./.git /workspace/.git
8+
RUN python set_path.py
9+
10+
ENV FLASK_ENV=development
11+
ENV DEBUG=true
12+
13+
EXPOSE 5000
14+
CMD gunicorn -c webserver/gunicorn_config.py webserver:app --no-sendfile
15+
16+

backend/webserver/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ def create_app():
7373
@app.route('/', defaults={'path': ''})
7474
@app.route('/<path:path>')
7575
def index(path):
76-
76+
7777
if app.debug:
7878
return requests.get('http://frontend:8080/{}'.format(path)).text
7979

backend/workers/Dockerfile

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,9 @@
1-
FROM python:3.6
1+
FROM jsbroks/coco-annotator:python-env
22

33
WORKDIR /workspace/
44

55
# Install python package dependices
66
COPY ./backend/ /workspace/
7-
COPY ./.git /workspace/.git
8-
9-
RUN pip install -r requirements.txt
107

118
EXPOSE 5555
129
CMD celery -A workers worker -l info

0 commit comments

Comments
 (0)