diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..07620ac --- /dev/null +++ b/.dockerignore @@ -0,0 +1,23 @@ +# IDEs +.idea/ +.vscode/ +.git/ +.gitignore +.dockerignore +.DS_Store +Thumbs.db + +# Python +**/__pycache__/ +**/*.py[cod] +**/*.pyo +**/*.pyd +venv/ +.env + +# Logs & Database & Broker data +*.log +**/mosquitto/data/ +**/mosquitto/log/ +**/postgres_data/ +**/pgadmin-data/ \ No newline at end of file diff --git a/.gitignore b/.gitignore index 3f20040..908fddb 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,25 @@ -agent/docker/mosquitto/data/ -agent/docker/mosquitto/log/ +# IDEs +.idea/ +.vscode/ +*.swp +*.swo -.idea/ \ No newline at end of file +# Python +venv/ +__pycache__/ +*.py[cod] +*$py.class +.env + +# Logs +*.log +app.log + +# Database & Broker data +**/mosquitto/data/ +**/mosquitto/log/ +**/postgres_data/ +**/pgadmin-data/ + +# OS specific +.DS_Store \ No newline at end of file diff --git a/.idea/.gitignore b/.idea/.gitignore deleted file mode 100644 index 26d3352..0000000 --- a/.idea/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -# Default ignored files -/shelf/ -/workspace.xml diff --git a/.idea/IoT-Systems.iml b/.idea/IoT-Systems.iml deleted file mode 100644 index 688aa87..0000000 --- a/.idea/IoT-Systems.iml +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/dbnavigator.xml b/.idea/dbnavigator.xml deleted file mode 100644 index 3b61c61..0000000 --- a/.idea/dbnavigator.xml +++ /dev/null @@ -1,425 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/inspectionProfiles/Project_Default.xml b/.idea/inspectionProfiles/Project_Default.xml deleted file mode 100644 index 977601b..0000000 --- a/.idea/inspectionProfiles/Project_Default.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - - \ No newline at end of file diff --git a/.idea/inspectionProfiles/profiles_settings.xml b/.idea/inspectionProfiles/profiles_settings.xml deleted file mode 100644 index 105ce2d..0000000 --- a/.idea/inspectionProfiles/profiles_settings.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml deleted file mode 100644 index df29e35..0000000 --- a/.idea/misc.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml deleted file mode 100644 index 5aef1d1..0000000 --- a/.idea/modules.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml deleted file mode 100644 index 94a25f7..0000000 --- a/.idea/vcs.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/MapView/.gitignore b/MapView/.gitignore deleted file mode 100644 index 26d0710..0000000 --- a/MapView/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -.idea -venv -__pycache__ diff --git a/agent/.gitignore b/agent/.gitignore deleted file mode 100644 index d75edea..0000000 --- a/agent/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -venv -__pycache__ \ No newline at end of file diff --git a/agent/Dockerfile b/agent/Dockerfile index 77f8852..6ee8458 100644 --- a/agent/Dockerfile +++ b/agent/Dockerfile @@ -3,10 +3,10 @@ FROM python:latest # set the working directory in the container WORKDIR /usr/agent # copy the dependencies file to the working directory -COPY requirements.txt . +COPY agent/requirements.txt . # install dependencies -RUN pip install -r requirements.txt +RUN pip install --no-cache-dir -r requirements.txt # copy the content of the local src directory to the working directory -COPY src/ . +COPY agent/src/ . # command to run on container start CMD ["python", "main.py"] \ No newline at end of file diff --git a/agent/docker/docker-compose.yaml b/agent/docker/docker-compose.yaml index 3059c9e..427ae07 100644 --- a/agent/docker/docker-compose.yaml +++ b/agent/docker/docker-compose.yaml @@ -16,7 +16,9 @@ services: fake_agent: container_name: agent - build: ../ + build: + context: ../../ + dockerfile: agent/Dockerfile depends_on: - mqtt environment: diff --git a/edge/.gitignore b/edge/.gitignore deleted file mode 100644 index 44d0711..0000000 --- a/edge/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -venv -app.log \ No newline at end of file diff --git a/edge/Dockerfile b/edge/Dockerfile index f87d862..6a68a38 100644 --- a/edge/Dockerfile +++ b/edge/Dockerfile @@ -3,9 +3,9 @@ FROM python:3.9-slim # Set the working directory inside the container WORKDIR /app # Copy the requirements.txt file and install dependencies -COPY requirements.txt . +COPY edge/requirements.txt . RUN pip install --no-cache-dir -r requirements.txt # Copy the entire application into the container -COPY . . +COPY edge/. . # Run the main.py script inside the container when it starts CMD ["python", "main.py"] \ No newline at end of file diff --git a/edge/docker/docker-compose.yaml b/edge/docker/docker-compose.yaml index 09f707a..6699f84 100644 --- a/edge/docker/docker-compose.yaml +++ b/edge/docker/docker-compose.yaml @@ -17,7 +17,9 @@ services: edge: container_name: edge - build: ../ + build: + context: ../../ + dockerfile: edge/Dockerfile depends_on: - mqtt environment: diff --git a/hub/.gitignore b/hub/.gitignore deleted file mode 100644 index d75edea..0000000 --- a/hub/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -venv -__pycache__ \ No newline at end of file diff --git a/hub/Dockerfile b/hub/Dockerfile index ffd3cbb..0224e66 100644 --- a/hub/Dockerfile +++ b/hub/Dockerfile @@ -3,9 +3,10 @@ FROM python:3.9-slim # Set the working directory inside the container WORKDIR /app # Copy the requirements.txt file and install dependencies -COPY requirements.txt . +COPY hub/requirements.txt . + RUN pip install --no-cache-dir -r requirements.txt # Copy the entire application into the container -COPY . . +COPY hub/. . # Run the main.py script inside the container when it starts CMD ["uvicorn", "main:app", "--host", "0.0.0.0"] \ No newline at end of file diff --git a/hub/docker/docker-compose.yaml b/hub/docker/docker-compose.yaml index ce1072a..639dbd4 100644 --- a/hub/docker/docker-compose.yaml +++ b/hub/docker/docker-compose.yaml @@ -1,4 +1,3 @@ -version: "3.9" name: "road_vision__hub" services: mqtt: @@ -16,7 +15,7 @@ services: postgres_db: - image: postgres:latest + image: postgres:17 container_name: postgres_db restart: always environment: @@ -49,7 +48,9 @@ services: store: container_name: store - build: ../../store + build: + context: ../../ + dockerfile: store/Dockerfile depends_on: - postgres_db restart: always @@ -77,7 +78,9 @@ services: hub: container_name: hub - build: ../ + build: + context: ../../ + dockerfile: hub/Dockerfile depends_on: - mqtt - redis diff --git a/store/.gitignore b/store/.gitignore deleted file mode 100644 index f810ad9..0000000 --- a/store/.gitignore +++ /dev/null @@ -1,5 +0,0 @@ -venv -__pycache__ -.idea - -.idea/ diff --git a/store/Dockerfile b/store/Dockerfile index d5f0458..f84af4c 100644 --- a/store/Dockerfile +++ b/store/Dockerfile @@ -3,9 +3,10 @@ FROM python:latest # Set the working directory inside the container WORKDIR /app # Copy the requirements.txt file and install dependencies -COPY requirements.txt . +COPY store/requirements.txt . + RUN pip install --no-cache-dir -r requirements.txt # Copy the entire application into the container -COPY . . +COPY store/. . # Run the main.py script inside the container when it starts CMD ["uvicorn", "main:app", "--host", "0.0.0.0"] \ No newline at end of file diff --git a/store/docker/docker-compose.yaml b/store/docker/docker-compose.yaml index dff34e5..6c9724b 100644 --- a/store/docker/docker-compose.yaml +++ b/store/docker/docker-compose.yaml @@ -34,7 +34,9 @@ services: store: container_name: store - build: .. + build: + context: ../../ + dockerfile: store/Dockerfile depends_on: - postgres_db restart: always