Skip to content

Commit 80a4eba

Browse files
committed
fix: SSL Certificate Issues with docker container
vidy-br: fix-certificate-issues
1 parent 8a16721 commit 80a4eba

1 file changed

Lines changed: 15 additions & 8 deletions

File tree

Dockerfile

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,23 @@
11
# Single stage build
22
FROM node:24-slim
33

4-
# Create non-root user with explicit IDs
4+
# Create non-root user with explicit IDs and install SSL certificates
55
RUN 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+
1821
WORKDIR /app
1922

2023
# Switch to non-root user
@@ -25,7 +28,7 @@ USER 1001:1001
2528
COPY --chown=1001:1001 package.json yarn.lock .yarnrc.yml ./
2629
COPY --chown=1001:1001 .yarn .yarn
2730

28-
# Install dependencies (CORRECTION PRINCIPALE)
31+
# Install dependencies
2932
RUN 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
3639
RUN 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
4046
ENV HOST=0.0.0.0
4147
ENV PORT=3000
48+
ENV GIT_SSL_CAINFO=/etc/ssl/certs/ca-certificates.crt
4249

4350
# Expose port for webhook server
4451
EXPOSE 3000

0 commit comments

Comments
 (0)