Skip to content

Commit

Permalink
Merge pull request #2 from rodrigobarbaedu/develop
Browse files Browse the repository at this point in the history
Release 2
  • Loading branch information
rodrigobarbaedu authored Nov 18, 2024
2 parents a9cdfae + 7e0cbdf commit 3611747
Show file tree
Hide file tree
Showing 13 changed files with 1,929 additions and 308 deletions.
709 changes: 512 additions & 197 deletions Application/color_ball_tracker.py

Large diffs are not rendered by default.

Empty file removed Application/docker/Dockerfile
Empty file.
27 changes: 27 additions & 0 deletions Application/docker/Dockerfile.app1
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Use Python 3.11 Slim as base image
FROM python:3.11-slim

# Enable working directory
WORKDIR /app

# Copy requirements.txt file to the container
COPY requirements.txt /app/

RUN apt-get update && apt-get install -y \
libgl1-mesa-glx libglib2.0-0 libsm6 libxrender1 libxext6

# Install dependencies
RUN python -m venv venv && \
. venv/bin/activate && \
pip install --no-cache-dir -r requirements.txt

# Expose the port 5050
EXPOSE 5050

# Copy the application code (app.py) from /app
COPY /static /app/static
COPY /templates /app/templates
COPY /obstacle_tracking.py /app/app.py

# Run the application
CMD ["/bin/bash", "-c", ". venv/bin/activate && python app.py"]
40 changes: 40 additions & 0 deletions Application/docker/Dockerfile.app2
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Use Python 3.11 Slim as base image
FROM python:3.11-slim

# Enable working directory
WORKDIR /app

# Copy requirements.txt file to the container
COPY requirements.txt /app/

# Install required packages
RUN apt-get update && apt-get install -y --no-install-recommends \
libqt5gui5 \
libqt5widgets5 \
libqt5core5a \
libxcb-xinerama0 \
libxcb1 \
libxkbcommon-x11-0 \
libglib2.0-0 \
libgl1-mesa-glx \
libfontconfig1 \
libdbus-1-3

# Clean up the apt cache
RUN apt-get clean && rm -rf /var/lib/apt/lists/*

# Install dependencies
RUN python -m venv venv && \
. venv/bin/activate && \
pip install --no-cache-dir -r requirements.txt

# Expose the port 5050
EXPOSE 5050

# Copy the application code (app.py) from /app
COPY /static /app/static
COPY /templates /app/templates
COPY /color_ball_tracker.py /app/app.py

# Run the application
CMD ["/bin/bash", "-c", ". venv/bin/activate && python app.py"]
24 changes: 24 additions & 0 deletions Application/docker/docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
version: '3.8'

services:
app-1:
build:
context: ../ # Specify the context of the build
dockerfile: docker/Dockerfile.app1 # Specify the Dockerfile to use
ports:
- "5050:5050" # Map port 5000 in the container to port 5050 on the host
networks:
- flask-network # Connect the container to the flask-network

app-2:
build:
context: ../ # Specify the context of the build
dockerfile: docker/Dockerfile.app2 # Specify the Dockerfile to use
ports:
- "5050:5050" # Map port 5000 in the container to port 5051 on the host
networks:
- flask-network # Connect the container to the flask-network

networks:
flask-network:
driver: bridge # Use the bridge network driver
Loading

0 comments on commit 3611747

Please sign in to comment.