Skip to content

Commit

Permalink
Ajuste a los puertos de frontend.
Browse files Browse the repository at this point in the history
  • Loading branch information
dsevilla committed Feb 28, 2024
1 parent a8079ef commit 75d2f77
Show file tree
Hide file tree
Showing 9 changed files with 24 additions and 15 deletions.
5 changes: 3 additions & 2 deletions proyecto/docker-compose-devel-mongo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,17 @@ services:
ssdd-frontend:
build: frontend/.
ports:
- 5010:5000
- 5010:5010
env_file: mongo.env
environment:
- FLASK_APP=app/app.py
- FLASK_DEBUG=true
- PORT=5010

ssdd-llamachat:
image: dsevilla/ssdd-llamachat:1.0
ports:
- 5020:5000
- 5020:5020

db-mongo:
build: db-mongo/.
Expand Down
5 changes: 3 additions & 2 deletions proyecto/docker-compose-devel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,17 @@ services:
ssdd-frontend:
build: frontend/.
ports:
- 5010:5000
- 5010:5010
env_file: sql.env
environment:
- FLASK_APP=app/app.py
- FLASK_DEBUG=true
- PORT=5010

ssdd-llamachat:
image: dsevilla/ssdd-llamachat:1.0
ports:
- 5020:5000
- 5020:5020

db-mysql:
build: db-mysql/.
Expand Down
5 changes: 3 additions & 2 deletions proyecto/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,17 @@ services:
ssdd-frontend:
image: dsevilla/ssdd-frontend:1.0
ports:
- 5010:5000
- 5010:5010
env_file: sql.env
environment:
- FLASK_APP=app/app.py
- FLASK_DEBUG=true
- PORT=5010

ssdd-llamachat:
image: dsevilla/ssdd-llamachat:1.0
ports:
- 5020:5000
- 5020:5020

db-mysql:
build: db-mysql/.
Expand Down
5 changes: 3 additions & 2 deletions proyecto/frontend/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ RUN pip install -r requirements.txt

ENV FLASK_APP="app/app.py"
ENV FLASK_DEBUG=true
ENV PORT=5010

EXPOSE 5000
EXPOSE 5010

CMD [ "flask", "run", "--host=0.0.0.0" ]
CMD [ "flask", "run", "--host=0.0.0.0", "--port=5010" ]
5 changes: 3 additions & 2 deletions proyecto/frontend/Dockerfile-devel
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ RUN pip install -r requirements.txt

ENV FLASK_APP="app/app.py"
ENV FLASK_DEBUG=false
ENV PORT=5010

EXPOSE 5000
EXPOSE 5010

CMD [ "flask", "run", "--host=0.0.0.0" ]
CMD [ "flask", "run", "--host=0.0.0.0", "--port=5010" ]
2 changes: 1 addition & 1 deletion proyecto/frontend/app/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,4 +64,4 @@ def load_user(user_id):
return None

if __name__ == '__main__':
app.run(debug=True, host='0.0.0.0')
app.run(debug=True, host='0.0.0.0', port=int(os.environ.get('PORT', 5010)))
3 changes: 2 additions & 1 deletion proyecto/frontend/docker-compose-devel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ services:
context: .
dockerfile: Dockerfile-devel
ports:
- "5010:5000"
- "5010:5010"
volumes:
- .:/ssdd-frontend
user: root
Expand All @@ -15,4 +15,5 @@ services:
environment:
- FLASK_APP=app/app.py
- FLASK_DEBUG=false
- PORT=5010

2 changes: 1 addition & 1 deletion proyecto/llamachat/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ ENV FLASK_DEBUG=true

EXPOSE 5020

CMD [ "flask", "run", "--host=0.0.0.0" ]
CMD [ "flask", "run", "--host=0.0.0.0", "--port=5020" ]
7 changes: 5 additions & 2 deletions proyecto/llamachat/app/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ def llm(self, token, prompt):

llm = LLM()

app = Flask(__name__, static_url_path='')

def init_model_and_process_requests():
global llm
Expand Down Expand Up @@ -85,6 +84,10 @@ def handle_response_request(prompt: dict) -> dict:

return token


app = Flask(__name__, static_url_path='', port=)


# Configurar el secret_key. OJO, no debe ir en un servidor git público.
# Python ofrece varias formas de almacenar esto de forma segura, que
# no cubriremos aquí.
Expand Down Expand Up @@ -134,4 +137,4 @@ def healthcheck():
# Start the download of the model, if needed
Thread(target=init_model_and_process_requests).start()

app.run(debug=True, host='0.0.0.0')
app.run(debug=True, host='0.0.0.0', port=int(os.environ.get('PORT', 5020)))

0 comments on commit 75d2f77

Please sign in to comment.