diff --git a/Dockerfile b/Dockerfile index 57830f2..45ae07a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -27,6 +27,7 @@ FROM alpine:latest # Create a non-root user and group RUN addgroup -S composync && adduser -S composync -G composync +RUN addgroup -S docker && adduser composync docker # Install runtime dependencies including bash, git, and Docker CLI RUN apk add --no-cache \ @@ -40,9 +41,6 @@ RUN apk add --no-cache \ RUN curl -L "https://github.com/docker/compose/releases/download/v2.14.0/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose && \ chmod +x /usr/local/bin/docker-compose -# Change permissions of Docker socket to allow access to the docker group -RUN chown root:docker /var/run/docker.sock && chmod 660 /var/run/docker.sock - # Copy the built Go application from the builder stage COPY --from=builder /app/composync /usr/local/bin/composync @@ -54,9 +52,6 @@ COPY entrypoint.sh /usr/local/bin/entrypoint.sh RUN chmod +x /usr/local/bin/entrypoint.sh && \ chown composync:composync /usr/local/bin/entrypoint.sh -# Add composync to the docker group for access to the socket -RUN addgroup composync docker - # Switch to the composync user USER composync @@ -64,4 +59,4 @@ USER composync ENTRYPOINT ["/usr/local/bin/entrypoint.sh"] # Default command (uses environment variables) -CMD ["go", "--interval=${INTERVAL}", "--repo=${REPO_URL}", "--branch=${BRANCH}", "--scan-dir=${SCAN_DIR}", "--recursive=${RECURSIVE}", "--username=${GIT_USERNAME}", "--token=${GIT_PAT}"] \ No newline at end of file +CMD ["go", "--interval=${INTERVAL}", "--repo=${REPO_URL}", "--branch=${BRANCH}", "--scan-dir=${SCAN_DIR}", "--recursive=${RECURSIVE}", "--username=${GIT_USERNAME}", "--token=${GIT_PAT}"]