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