Skip to content

Commit

Permalink
change Dockerfile and README
Browse files Browse the repository at this point in the history
  • Loading branch information
LeoOMaia committed Nov 25, 2023
1 parent 2973173 commit e439938
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 3 deletions.
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,13 @@ Rodar ``server.py``, depois rodar ``client.py`` desse jeito: ``python client.py
kubectl describe pod <nome do pod>
kubectl describe service <nome do servico>
kubectl describe pvc <nome do volume>
```

## Testando REST_API
```
wget --server-response \
--output-document response.out \
--header='Content-Type: application/json' \
--post-data '{"songs": ["Yesterday", "Bohemian Rhapsody"]}' \
http://10.96.150.194:32196/api/recommend
```
2 changes: 1 addition & 1 deletion Rest_API/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FROM python:latest
RUN pip install flask pandas
COPY server.py /app/server.py
WORKDIR /app
COPY . /app
EXPOSE 32196
CMD ["python", "server.py", "--host=0.0.0.0"]
2 changes: 1 addition & 1 deletion Train_model/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
FROM python:latest
RUN pip install mlxtend pandas
COPY ml.py /app/ml.py
WORKDIR /app
COPY . /app
CMD ["python", "ml.py"]
2 changes: 1 addition & 1 deletion client.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import sys
import json

api_url = 'http://127.0.0.1:32196/api/recommend'
api_url = 'http://10.96.150.194:32196/api/recommend'

if len(sys.argv) < 2:
print("Usage: python client.py <song1> ...")
Expand Down

0 comments on commit e439938

Please sign in to comment.