diff --git a/Dockerfile b/Dockerfile index c0053b2..aafa859 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,5 @@ FROM python:3.11.7-slim-bookworm WORKDIR /app -COPY src . +COPY api . RUN pip install -r requirements.txt CMD python3 app.py diff --git a/api/app.py b/api/app.py index fd7a054..ce77389 100644 --- a/api/app.py +++ b/api/app.py @@ -9,7 +9,7 @@ import os if __name__ == "__main__": load_dotenv() app = Flask(__name__) - app.config['SQLALCHEMY_DATABASE_URI'] = os.getenv('DATABASE_URI') + app.config['SQLALCHEMY_DATABASE_URI'] = os.getenv('SQLALCHEMY_DATABASE_URI') app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = True app.config['JWT_SECRET_KEY'] = 'changeme' app.register_blueprint(user_bp) diff --git a/api/requirements.txt b/api/requirements.txt index 82965c0..4f817c0 100644 --- a/api/requirements.txt +++ b/api/requirements.txt @@ -1,11 +1,13 @@ blinker==1.7.0 click==8.1.7 Flask==3.0.0 +Flask-JWT-Extended==4.7.1 Flask-SQLAlchemy==3.1.1 greenlet==3.0.1 itsdangerous==2.1.2 Jinja2==3.1.2 MarkupSafe==2.1.3 +mysql-connector-python==9.2.0 python-dotenv==1.0.0 SQLAlchemy==2.0.23 typing_extensions==4.8.0 diff --git a/docker-compose.yml b/docker-compose.yml index 7f9b5cd..4ba2a1f 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,13 +1,17 @@ -version: '3.7' - services: - web: + api: container_name: todo-api hostname: todo-api build: . env_file: - - src/.env + - api/.env ports: - "5000:5000" - volumes: - - ./src/test.db:/app/test.db + #volumes: + #- ./api/test.db:/app/test.db + db: + container_name: db + hostname: db + image: mysql:latest + env_file: + - db/.env