Skip to content

Commit 865dd11

Browse files
committed
changed container recognition
1 parent 579ab60 commit 865dd11

2 files changed

Lines changed: 11 additions & 2 deletions

File tree

docker-compose-data/webdock-ui/Dockerfile

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@ RUN apt-get update && \
1717
apt-get install -y docker-ce-cli && \
1818
rm -rf /var/lib/apt/lists/*
1919

20+
# Erstelle Docker-Gruppe und füge Benutzer hinzu
21+
RUN groupadd -g 999 docker && \
22+
useradd -r -u 999 -g docker webdock
23+
2024
# Python-Abhängigkeiten
2125
COPY requirements.txt .
2226
RUN pip install --no-cache-dir -r requirements.txt
@@ -40,8 +44,9 @@ COPY docker-compose-files/ /app/docker-compose-files/
4044
COPY docker-compose-files/webdock-ui/src/static/img/icons/* /app/static/img/icons/
4145

4246
# Setze Berechtigungen
43-
RUN chmod -R 755 /app
44-
RUN chown -R root:root /app
47+
RUN chmod -R 755 /app && \
48+
chown -R webdock:docker /app && \
49+
chmod 666 /var/run/docker.sock || true
4550

4651
# Setze Umgebungsvariablen
4752
ENV FLASK_APP=app.py
@@ -55,5 +60,8 @@ EXPOSE 80
5560
HEALTHCHECK --interval=30s --timeout=30s --start-period=5s --retries=3 \
5661
CMD curl -f http://localhost/test || exit 1
5762

63+
# Wechsle zum webdock Benutzer
64+
USER webdock
65+
5866
# Starte die Flask-App
5967
CMD ["python3", "/app/app.py"]

docker-compose.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,5 @@ services:
1111
- ./config:/app/config
1212
environment:
1313
- CONFIG_DIR=/app/config
14+
- DOCKER_GID=999
1415
restart: unless-stopped

0 commit comments

Comments
 (0)