Skip to content

Commit 53f9ac6

Browse files
committed
Add Dockerfile for testing
- Testing integration with MusicBrainz - Add documentation for the same
1 parent 25bb904 commit 53f9ac6

File tree

3 files changed

+117
-2
lines changed

3 files changed

+117
-2
lines changed

README.md

Lines changed: 32 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# SpamBrainz API
22
An API to classify editor account using LodBrok(keras model) in the backend. Also has an option to retrain the model for future enhancement by taking incorrect predictions into consideration as per SpamNinja feedback.
33

4-
### Steps to run the API:
4+
### Steps to run the API
55

66
1) Install all the dependencies needed in virtual environment:
77

@@ -41,4 +41,34 @@ This should run the API in the specified port in debug mode
4141

4242
The detailed internal functioning of API is present [here](spambrainz/app/README.md)
4343

44-
The request used, their details and the output are present [here](spambrainz/README.md)
44+
The request used, their details and the output are present [here](spambrainz/README.md)
45+
46+
### Dockerization for testing
47+
48+
- Having a docker container of the application would help for further testing with different datasets.
49+
50+
- To do this, one must have docker installed in your local machine.
51+
52+
- A Redis Docker container instance is needed to be used by our application. To run a Redis Docker instance, run the following command:
53+
54+
55+
```
56+
$ docker run --name rdb -p 6379:6379 redis
57+
# if already present remove it using
58+
$ docker rm rdb
59+
60+
```
61+
62+
- After Redis is running go to another folder and run the Dockerfile to start the API.
63+
64+
- After this run the following command in spambrainz directory to build the docker image.
65+
66+
```
67+
$ docker build -t spambrainz:latest .
68+
```
69+
70+
- Now, you have the build ready with you. Run the build with the following command
71+
72+
```
73+
$ sudo docker run -it spambrainz
74+
```

spambrainz/Dockerfile

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
ARG UBUNTU_VERSION=18.04
2+
3+
FROM ubuntu:${UBUNTU_VERSION} as base
4+
5+
ENV LANG C.UTF-8
6+
7+
RUN apt-get update && apt-get install -y \
8+
python3 \
9+
python3-pip
10+
11+
RUN python3 -m pip --no-cache-dir install --upgrade \
12+
pip \
13+
setuptools
14+
15+
RUN ln -s $(which python3) /usr/local/bin/python
16+
17+
WORKDIR /app
18+
19+
COPY . /app
20+
21+
RUN pip --no-cache-dir install -r requirements_docker.txt
22+
23+
EXPOSE 5000
24+
25+
ENTRYPOINT ["python"]
26+
27+
CMD ["sb_api.py"]

spambrainz/requirements_docker.txt

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
absl-py==0.9.0
2+
aniso8601==8.0.0
3+
appdirs==1.4.4
4+
astor==0.8.1
5+
astunparse==1.6.3
6+
cachetools==4.1.1
7+
certifi==2020.6.20
8+
chardet==3.0.4
9+
click==7.1.2
10+
DateTime==4.3
11+
filelock==3.0.12
12+
Flask==1.1.2
13+
Flask-RESTful==0.3.8
14+
gast==0.3.3
15+
gevent==20.6.2
16+
google-auth==1.20.0
17+
google-auth-oauthlib==0.4.1
18+
google-pasta==0.2.0
19+
greenlet==0.4.16
20+
grpcio==1.30.0
21+
h5py==2.10.0
22+
idna==2.10
23+
importlib-metadata==1.7.0
24+
itsdangerous==1.1.0
25+
Jinja2==2.11.2
26+
Keras==2.3.1
27+
Keras-Applications==1.0.8
28+
Keras-Preprocessing==1.1.2
29+
Markdown==3.2.2
30+
MarkupSafe==1.1.1
31+
mbdata==25.0.4
32+
numpy==1.18.5
33+
oauthlib==3.1.0
34+
opt-einsum==3.3.0
35+
protobuf==3.12.4
36+
pyasn1==0.4.8
37+
pyasn1-modules==0.2.8
38+
pytz==2020.1
39+
PyYAML==5.3.1
40+
redis==3.5.3
41+
requests==2.24.0
42+
requests-oauthlib==1.3.0
43+
rsa==4.6
44+
scipy==1.4.1
45+
six==1.15.0
46+
tensorboard==2.3.0
47+
tensorboard-plugin-wit==1.7.0
48+
tensorflow==2.3.0
49+
tensorflow-estimator==2.3.0
50+
termcolor==1.1.0
51+
uritools==3.0.0
52+
urlextract==1.0.0
53+
urllib3==1.25.10
54+
Werkzeug==1.0.1
55+
wrapt==1.12.1
56+
zipp==3.1.0
57+
zope.event==4.4
58+
zope.interface==5.1.0

0 commit comments

Comments
 (0)