11# Single stage build
22FROM node:24-slim
33
4- # Create non-root user with explicit IDs
4+ # Create non-root user with explicit IDs and install SSL certificates
55RUN groupadd -g 1001 nonroot && \
66 useradd -u 1001 -g nonroot -s /bin/bash -m nonroot && \
77 apt-get update && \
88 apt-get install --no-install-recommends -y \
99 build-essential \
10+ ca-certificates \
1011 curl \
11- git && \
12+ git \
13+ openssl && \
1214 apt-get clean && \
13- rm -rf /var/lib/apt/lists/*
14-
15- # Create app directory and set ownership
16- RUN mkdir -p /app && \
15+ rm -rf /var/lib/apt/lists/* && \
16+ update-ca-certificates && \
17+ # Create app directory and set ownership
18+ mkdir -p /app && \
1719 chown 1001:1001 /app
20+
1821WORKDIR /app
1922
2023# Switch to non-root user
@@ -25,7 +28,7 @@ USER 1001:1001
2528COPY --chown=1001:1001 package.json yarn.lock .yarnrc.yml ./
2629COPY --chown=1001:1001 .yarn .yarn
2730
28- # Install dependencies (CORRECTION PRINCIPALE)
31+ # Install dependencies
2932RUN yarn install --immutable
3033
3134# Copy source code (including templates needed for PR review prompts)
@@ -34,11 +37,15 @@ COPY --chown=1001:1001 templates/ templates/
3437
3538# Create repository directory for cloning with appropriate permissions
3639RUN mkdir -p /app/repos && \
37- chmod u+w /app/repos
40+ chmod u+w /app/repos && \
41+ # Configure git for SSL certificate verification
42+ git config --global http.sslverify true && \
43+ git config --global http.sslcainfo /etc/ssl/certs/ca-certificates.crt
3844
3945# Set environment variables for server configuration
4046ENV HOST=0.0.0.0
4147ENV PORT=3000
48+ ENV GIT_SSL_CAINFO=/etc/ssl/certs/ca-certificates.crt
4249
4350# Expose port for webhook server
4451EXPOSE 3000
0 commit comments