Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

2024-10-22 09:09 - #10

Merged
merged 1 commit into from
Oct 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 6 additions & 8 deletions backend/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,20 +1,18 @@
# Dockerfile for Backend (Flask API)

# Usa una imagen base con Python
# Usa una imagen base de Python
FROM python:3.9-slim

# Establece el directorio de trabajo
# Establece el directorio de trabajo dentro del contenedor
WORKDIR /app

# Copia los archivos de requerimientos y luego los instala
# Copia el archivo de dependencias y luego instálalas
COPY requirements.txt requirements.txt
RUN pip install --no-cache-dir -r requirements.txt

# Copia el código de la aplicación
# Copia el código de la aplicación dentro del contenedor
COPY . .

# Expone el puerto 5000 para la API Flask
# Expone el puerto 5000 para Flask
EXPOSE 5000

# Comando para ejecutar la API
# Comando para iniciar la aplicación Flask
CMD ["python", "app.py"]
12 changes: 12 additions & 0 deletions backend/app.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
from flask import Flask, jsonify

app = Flask(__name__)

# Ruta principal (home) que devuelve un mensaje de saludo
@app.route('/')
def home():
return jsonify({"message": "Hello, World! This is your Flask API"}), 200

# Iniciar la aplicación
if __name__ == '__main__':
app.run(host='0.0.0.0', port=5000)
3 changes: 1 addition & 2 deletions backend/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
Flask==2.0.1
Flask-Cors==3.0.10
Flask>=2.0.1
Loading