update docker file
This commit is contained in:
@@ -15,6 +15,9 @@ jobs:
|
||||
run: |
|
||||
echo "Current workspace: $(pwd)"
|
||||
|
||||
# Clean workspace first
|
||||
rm -rf * .git* 2>/dev/null || true
|
||||
|
||||
# Clone the repository since Gitea runner doesn't auto-checkout
|
||||
echo "Cloning repository..."
|
||||
git clone https://gitea.skalas.org/jskala/NFOguard.git /tmp/repo
|
||||
@@ -24,6 +27,8 @@ jobs:
|
||||
|
||||
echo "Repository cloned successfully"
|
||||
ls -la
|
||||
echo "Checking Dockerfile:"
|
||||
head -30 Dockerfile
|
||||
|
||||
- name: Check Docker availability
|
||||
run: |
|
||||
|
||||
+17
-19
@@ -21,25 +21,23 @@ COPY VERSION .
|
||||
RUN mkdir -p /app/data && chown -R appuser:appuser /app
|
||||
|
||||
# Root-aware entrypoint
|
||||
RUN cat > /entrypoint.sh << 'EOF'
|
||||
#!/bin/bash
|
||||
set -euo pipefail
|
||||
|
||||
PUID=${PUID:-1000}
|
||||
PGID=${PGID:-1000}
|
||||
|
||||
if [ "$(id -u)" -eq 0 ]; then
|
||||
# running as root: we can adjust IDs and drop privileges
|
||||
groupmod -o -g "$PGID" appuser 2>/dev/null || groupadd -o -g "$PGID" appuser
|
||||
id appuser &>/dev/null || useradd -o -u "$PUID" -g "$PGID" -m appuser
|
||||
usermod -o -u "$PUID" -g "$PGID" appuser 2>/dev/null || true
|
||||
chown -R "$PUID:$PGID" /app || true
|
||||
exec gosu appuser "$@"
|
||||
else
|
||||
# not root (e.g., compose set user: 1000:1000) — just run
|
||||
exec "$@"
|
||||
fi
|
||||
EOF
|
||||
RUN echo '#!/bin/bash' > /entrypoint.sh && \
|
||||
echo 'set -euo pipefail' >> /entrypoint.sh && \
|
||||
echo '' >> /entrypoint.sh && \
|
||||
echo 'PUID=${PUID:-1000}' >> /entrypoint.sh && \
|
||||
echo 'PGID=${PGID:-1000}' >> /entrypoint.sh && \
|
||||
echo '' >> /entrypoint.sh && \
|
||||
echo 'if [ "$(id -u)" -eq 0 ]; then' >> /entrypoint.sh && \
|
||||
echo ' # running as root: we can adjust IDs and drop privileges' >> /entrypoint.sh && \
|
||||
echo ' groupmod -o -g "$PGID" appuser 2>/dev/null || groupadd -o -g "$PGID" appuser' >> /entrypoint.sh && \
|
||||
echo ' id appuser &>/dev/null || useradd -o -u "$PUID" -g "$PGID" -m appuser' >> /entrypoint.sh && \
|
||||
echo ' usermod -o -u "$PUID" -g "$PGID" appuser 2>/dev/null || true' >> /entrypoint.sh && \
|
||||
echo ' chown -R "$PUID:$PGID" /app || true' >> /entrypoint.sh && \
|
||||
echo ' exec gosu appuser "$@"' >> /entrypoint.sh && \
|
||||
echo 'else' >> /entrypoint.sh && \
|
||||
echo ' # not root (e.g., compose set user: 1000:1000) — just run' >> /entrypoint.sh && \
|
||||
echo ' exec "$@"' >> /entrypoint.sh && \
|
||||
echo 'fi' >> /entrypoint.sh
|
||||
RUN chmod +x /entrypoint.sh
|
||||
|
||||
HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
|
||||
|
||||
Reference in New Issue
Block a user