Skip to content

Commit 3f90104

Browse files
authored
Merge pull request #3 from e-Learning-by-SSE/main
fix(Docker): Eliminates resource leaks by avoiding zombie processes
2 parents a331610 + c645373 commit 3f90104

2 files changed

Lines changed: 16 additions & 5 deletions

File tree

Dockerfile

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,17 @@ FROM nvidia/cuda:12.2.2-cudnn8-runtime-ubuntu22.04
22

33
# Install required packages
44
ENV DEBIAN_FRONTEND=noninteractive
5-
RUN apt update && apt install -y python3 python3-pip python3-venv python3-dev ffmpeg sudo python-is-python3 rabbitmq-server
5+
RUN apt update && apt install -y \
6+
python3 \
7+
python3-pip \
8+
python3-venv \
9+
python3-dev \
10+
python-is-python3 \
11+
ffmpeg \
12+
sudo \
13+
rabbitmq-server \
14+
tini \
15+
&& rm -rf /var/lib/apt/lists/*
616

717
# Copy project into image
818
WORKDIR /app
@@ -15,4 +25,5 @@ RUN pip install --no-cache-dir -r requirements.txt
1525
COPY docker-entrypoint.sh /entrypoint.sh
1626
RUN chmod +x /entrypoint.sh
1727

18-
ENTRYPOINT ["/entrypoint.sh"]
28+
# Use tini to handle zombies
29+
ENTRYPOINT ["/usr/bin/tini", "--", "/entrypoint.sh"]

docker-entrypoint.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/bash
2-
# Starte RabbitMQ im Hintergrund
2+
# Starting RabbitMQ in background
33
sudo service rabbitmq-server start
44

5-
# Starte die Python-Anwendung
6-
exec python start.py
5+
# Starting the actual python app
6+
exec python start.py

0 commit comments

Comments
 (0)