diff --git a/microservices/bikes_service/Dockerfile b/admins_service/Dockerfile similarity index 89% rename from microservices/bikes_service/Dockerfile rename to admins_service/Dockerfile index 6780237e514fd945a9339050820bea3a3e2b2ebe..a1edbd778c011fae8bc1f8349e0c8a7c40363e25 100644 --- a/microservices/bikes_service/Dockerfile +++ b/admins_service/Dockerfile @@ -12,6 +12,8 @@ RUN pip install --no-cache-dir -r requirements.txt # Copy the rest of the application code to the working directory COPY . . + +# Expose the port specified by the environment variable EXPOSE 8001 # Command to run the application diff --git a/microservices/admins_service/main.py b/admins_service/main.py similarity index 100% rename from microservices/admins_service/main.py rename to admins_service/main.py diff --git a/microservices/admins_service/DockerFIle b/bikes_service/Dockerfile similarity index 89% rename from microservices/admins_service/DockerFIle rename to bikes_service/Dockerfile index 1b85985223631643774e3b43b48bf6b4c3ab2d28..461dd7223d3413ee9c553b35f236bece333fee6a 100644 --- a/microservices/admins_service/DockerFIle +++ b/bikes_service/Dockerfile @@ -13,6 +13,7 @@ RUN pip install --no-cache-dir -r requirements.txt # Copy the rest of the application code to the working directory COPY . . +# Expose the port specified by the environment variable EXPOSE 8002 # Command to run the application diff --git a/microservices/bikes_service/local_bike.db b/bikes_service/local_bike.db similarity index 100% rename from microservices/bikes_service/local_bike.db rename to bikes_service/local_bike.db diff --git a/microservices/bikes_service/main.py b/bikes_service/main.py similarity index 100% rename from microservices/bikes_service/main.py rename to bikes_service/main.py diff --git a/microservices/admins_service/requirements.txt b/microservices/admins_service/requirements.txt deleted file mode 100644 index 6c5d0fd629eb8d43f287e646dcef2a1d9fb7a8f4..0000000000000000000000000000000000000000 --- a/microservices/admins_service/requirements.txt +++ /dev/null @@ -1,34 +0,0 @@ -annotated-types==0.6.0 -anyio==4.3.0 -certifi==2024.2.2 -click==8.1.7 -dnspython==2.6.1 -email_validator==2.1.1 -exceptiongroup==1.2.0 -fastapi==0.110.0 -greenlet==3.0.3 -h11==0.14.0 -httpcore==1.0.5 -httptools==0.6.1 -httpx==0.27.0 -idna==3.6 -itsdangerous==2.1.2 -Jinja2==3.1.3 -MarkupSafe==2.1.5 -orjson==3.10.0 -pydantic==2.6.4 -pydantic-extra-types==2.6.0 -pydantic-settings==2.2.1 -pydantic_core==2.16.3 -python-dotenv==1.0.1 -python-multipart==0.0.9 -PyYAML==6.0.1 -sniffio==1.3.1 -SQLAlchemy==2.0.29 -starlette==0.36.3 -typing_extensions==4.10.0 -ujson==5.9.0 -uvicorn==0.29.0 -uvloop==0.19.0 -watchfiles==0.21.0 -websockets==12.0 diff --git a/microservices/bikes_service/requirements.txt b/microservices/bikes_service/requirements.txt deleted file mode 100644 index 6c5d0fd629eb8d43f287e646dcef2a1d9fb7a8f4..0000000000000000000000000000000000000000 --- a/microservices/bikes_service/requirements.txt +++ /dev/null @@ -1,34 +0,0 @@ -annotated-types==0.6.0 -anyio==4.3.0 -certifi==2024.2.2 -click==8.1.7 -dnspython==2.6.1 -email_validator==2.1.1 -exceptiongroup==1.2.0 -fastapi==0.110.0 -greenlet==3.0.3 -h11==0.14.0 -httpcore==1.0.5 -httptools==0.6.1 -httpx==0.27.0 -idna==3.6 -itsdangerous==2.1.2 -Jinja2==3.1.3 -MarkupSafe==2.1.5 -orjson==3.10.0 -pydantic==2.6.4 -pydantic-extra-types==2.6.0 -pydantic-settings==2.2.1 -pydantic_core==2.16.3 -python-dotenv==1.0.1 -python-multipart==0.0.9 -PyYAML==6.0.1 -sniffio==1.3.1 -SQLAlchemy==2.0.29 -starlette==0.36.3 -typing_extensions==4.10.0 -ujson==5.9.0 -uvicorn==0.29.0 -uvloop==0.19.0 -watchfiles==0.21.0 -websockets==12.0 diff --git a/microservices/my_ride.db b/microservices/my_ride.db deleted file mode 100644 index 865b2b7182c807dfa9118534660eb75e09466302..0000000000000000000000000000000000000000 Binary files a/microservices/my_ride.db and /dev/null differ diff --git a/microservices/rentals_service/requirements.txt b/microservices/rentals_service/requirements.txt deleted file mode 100644 index 6c5d0fd629eb8d43f287e646dcef2a1d9fb7a8f4..0000000000000000000000000000000000000000 --- a/microservices/rentals_service/requirements.txt +++ /dev/null @@ -1,34 +0,0 @@ -annotated-types==0.6.0 -anyio==4.3.0 -certifi==2024.2.2 -click==8.1.7 -dnspython==2.6.1 -email_validator==2.1.1 -exceptiongroup==1.2.0 -fastapi==0.110.0 -greenlet==3.0.3 -h11==0.14.0 -httpcore==1.0.5 -httptools==0.6.1 -httpx==0.27.0 -idna==3.6 -itsdangerous==2.1.2 -Jinja2==3.1.3 -MarkupSafe==2.1.5 -orjson==3.10.0 -pydantic==2.6.4 -pydantic-extra-types==2.6.0 -pydantic-settings==2.2.1 -pydantic_core==2.16.3 -python-dotenv==1.0.1 -python-multipart==0.0.9 -PyYAML==6.0.1 -sniffio==1.3.1 -SQLAlchemy==2.0.29 -starlette==0.36.3 -typing_extensions==4.10.0 -ujson==5.9.0 -uvicorn==0.29.0 -uvloop==0.19.0 -watchfiles==0.21.0 -websockets==12.0 diff --git a/microservices/reviews_service/requirements.txt b/microservices/reviews_service/requirements.txt deleted file mode 100644 index 6c5d0fd629eb8d43f287e646dcef2a1d9fb7a8f4..0000000000000000000000000000000000000000 --- a/microservices/reviews_service/requirements.txt +++ /dev/null @@ -1,34 +0,0 @@ -annotated-types==0.6.0 -anyio==4.3.0 -certifi==2024.2.2 -click==8.1.7 -dnspython==2.6.1 -email_validator==2.1.1 -exceptiongroup==1.2.0 -fastapi==0.110.0 -greenlet==3.0.3 -h11==0.14.0 -httpcore==1.0.5 -httptools==0.6.1 -httpx==0.27.0 -idna==3.6 -itsdangerous==2.1.2 -Jinja2==3.1.3 -MarkupSafe==2.1.5 -orjson==3.10.0 -pydantic==2.6.4 -pydantic-extra-types==2.6.0 -pydantic-settings==2.2.1 -pydantic_core==2.16.3 -python-dotenv==1.0.1 -python-multipart==0.0.9 -PyYAML==6.0.1 -sniffio==1.3.1 -SQLAlchemy==2.0.29 -starlette==0.36.3 -typing_extensions==4.10.0 -ujson==5.9.0 -uvicorn==0.29.0 -uvloop==0.19.0 -watchfiles==0.21.0 -websockets==12.0 diff --git a/microservices/users_service/requirements.txt b/microservices/users_service/requirements.txt deleted file mode 100644 index 6c5d0fd629eb8d43f287e646dcef2a1d9fb7a8f4..0000000000000000000000000000000000000000 --- a/microservices/users_service/requirements.txt +++ /dev/null @@ -1,34 +0,0 @@ -annotated-types==0.6.0 -anyio==4.3.0 -certifi==2024.2.2 -click==8.1.7 -dnspython==2.6.1 -email_validator==2.1.1 -exceptiongroup==1.2.0 -fastapi==0.110.0 -greenlet==3.0.3 -h11==0.14.0 -httpcore==1.0.5 -httptools==0.6.1 -httpx==0.27.0 -idna==3.6 -itsdangerous==2.1.2 -Jinja2==3.1.3 -MarkupSafe==2.1.5 -orjson==3.10.0 -pydantic==2.6.4 -pydantic-extra-types==2.6.0 -pydantic-settings==2.2.1 -pydantic_core==2.16.3 -python-dotenv==1.0.1 -python-multipart==0.0.9 -PyYAML==6.0.1 -sniffio==1.3.1 -SQLAlchemy==2.0.29 -starlette==0.36.3 -typing_extensions==4.10.0 -ujson==5.9.0 -uvicorn==0.29.0 -uvloop==0.19.0 -watchfiles==0.21.0 -websockets==12.0 diff --git a/microservices/rentals_service/DockerFIle b/rentals_service/Dockerfile similarity index 87% rename from microservices/rentals_service/DockerFIle rename to rentals_service/Dockerfile index 4314cb6383888fb96dfe6fcc8a20b207a8b770a9..69b18e1cd105c16632e656e47cc1699926a0e153 100644 --- a/microservices/rentals_service/DockerFIle +++ b/rentals_service/Dockerfile @@ -13,5 +13,8 @@ RUN pip install --no-cache-dir -r requirements.txt # Copy the rest of the application code to the working directory COPY . . +# Expose the port specified by the environment variable +EXPOSE 8003 + # Command to run the application CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8003"] diff --git a/microservices/rentals_service/main.py b/rentals_service/main.py similarity index 100% rename from microservices/rentals_service/main.py rename to rentals_service/main.py diff --git a/microservices/users_service/DockerFIle b/reviews_service/Dockerfile similarity index 72% rename from microservices/users_service/DockerFIle rename to reviews_service/Dockerfile index 0ec1be9d080265daa252683be7273c95435bccbf..67ca58e51841e93ed048a1d68c0b27ed2970d9af 100644 --- a/microservices/users_service/DockerFIle +++ b/reviews_service/Dockerfile @@ -13,7 +13,8 @@ RUN pip install --no-cache-dir -r requirements.txt # Copy the rest of the application code to the working directory COPY . . -EXPOSE 8005 +# Expose the port specified by the environment variable +EXPOSE $SERVICE_PORT # Command to run the application -CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8005"] +CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "$SERVICE_PORT"] diff --git a/microservices/reviews_service/main.py b/reviews_service/main.py similarity index 98% rename from microservices/reviews_service/main.py rename to reviews_service/main.py index 8a5d39ec6247a137c6b920e7380d8ae5a75d9d41..ce085ac51010f1d5c2ddbac1882addb4553e455c 100644 --- a/microservices/reviews_service/main.py +++ b/reviews_service/main.py @@ -28,7 +28,7 @@ cursor = conn.cursor() # Create the Reviews table if it doesn't exist cursor.execute(''' CREATE TABLE IF NOT EXISTS Reviews ( - review_id INTEGER PRIMARY KEY, + review_id INTEGER PRIMARY KEY AUTOINCREMENT, user_id INT, bike_id INT, rating INT, diff --git a/microservices/reviews_service/DockerFIle b/users_service/Dockerfile similarity index 72% rename from microservices/reviews_service/DockerFIle rename to users_service/Dockerfile index b34fe12f481f9fb25193dd7a52f88bcf0ce9d5ce..67ca58e51841e93ed048a1d68c0b27ed2970d9af 100644 --- a/microservices/reviews_service/DockerFIle +++ b/users_service/Dockerfile @@ -13,7 +13,8 @@ RUN pip install --no-cache-dir -r requirements.txt # Copy the rest of the application code to the working directory COPY . . -EXPOSE 8004 +# Expose the port specified by the environment variable +EXPOSE $SERVICE_PORT # Command to run the application -CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8004"] +CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "$SERVICE_PORT"] diff --git a/microservices/users_service/main.py b/users_service/main.py similarity index 100% rename from microservices/users_service/main.py rename to users_service/main.py