Skip to content

Commit a3e9deb

Browse files
authored
Merge pull request #4 from ParkTrack-Project/Dockerfile_add
Dockerfile added
2 parents d7ed741 + bb280e8 commit a3e9deb

2 files changed

Lines changed: 24 additions & 0 deletions

File tree

Dockerfile

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
FROM python:3.10-slim
2+
3+
WORKDIR /app
4+
5+
# Install system dependencies for OpenCV
6+
# Removed gcc and libpq-dev as we use psycopg2-binary
7+
RUN apt-get update && apt-get install -y --no-install-recommends \
8+
libgl1 \
9+
libglib2.0-0 \
10+
&& rm -rf /var/lib/apt/lists/*
11+
12+
COPY requirements.txt .
13+
RUN pip install --no-cache-dir -r requirements.txt
14+
15+
COPY src/ ./src/
16+
17+
# Environment variables will be passed via docker-compose
18+
CMD ["python", "src/main.py"]

src/db_manager/db_manager.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -294,6 +294,12 @@ def get_next_camera(self):
294294

295295
self._next_camera()
296296

297+
if camera is None:
298+
camera = session.query(Camera).filter(Camera.is_active.is_(True)).first()
299+
if camera:
300+
self.camera_index = camera.id
301+
self._next_camera()
302+
297303
return camera.serialize() if camera is not None else {}
298304

299305
def get_camera(self, camera_id):

0 commit comments

Comments
 (0)