Skip to content

Commit

Permalink
Add INTERNAL_ROOT_CA
Browse files Browse the repository at this point in the history
  • Loading branch information
danthonywalker committed Jan 3, 2025
1 parent 210be01 commit a0ca82d
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 15 deletions.
1 change: 1 addition & 0 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ jobs:
tags: |
rg.nl-ams.scw.cloud/dreamexposure/pedestrian:latest
rg.nl-ams.scw.cloud/dreamexposure/pedestrian:${{ github.ref_name }}
build-args: INTERNAL_ROOT_CA="${{ vars.INTERNAL_ROOT_CA }}"

- name: Build & push Pedestrian Flyway
uses: docker/build-push-action@v4
Expand Down
35 changes: 20 additions & 15 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,24 @@ FROM node:20.8.0 as base
WORKDIR /pedestrian
# Install Chrome dependencies for puppeteer
RUN apt-get update \
&& apt-get install -y wget gnupg \
&& wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - \
&& sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list' \
&& apt-get update \
&& apt-get install -y google-chrome-stable fonts-ipafont-gothic fonts-wqy-zenhei fonts-thai-tlwg fonts-kacst fonts-freefont-ttf libxss1 \
--no-install-recommends \
&& rm -rf /var/lib/apt/lists/* \
# Add puppeteer user for Chrome sandbox
&& groupadd -r pptruser \
&& useradd -r -g pptruser -G audio,video pptruser \
&& mkdir -p /home/pptruser/Downloads \
&& chown -R pptruser:pptruser /home/pptruser \
&& chown -R pptruser:pptruser /pedestrian
&& apt-get install -y wget gnupg \
&& wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - \
&& sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list' \
&& apt-get update \
&& apt-get install -y google-chrome-stable fonts-ipafont-gothic fonts-wqy-zenhei fonts-thai-tlwg fonts-kacst fonts-freefont-ttf libxss1 \
--no-install-recommends \
&& rm -rf /var/lib/apt/lists/* \
# Add puppeteer user for Chrome sandbox
&& groupadd -r pptruser \
&& useradd -r -g pptruser -G audio,video pptruser \
&& mkdir -p /home/pptruser/Downloads \
&& chown -R pptruser:pptruser /home/pptruser \
&& chown -R pptruser:pptruser /pedestrian

ARG INTERNAL_ROOT_CA=""
ENV INTERNAL_ROOT_CA=${INTERNAL_ROOT_CA}
RUN ([ "$INTERNAL_ROOT_CA" != "" ] && apt-get install -y ca-certificates && mkdir -p /usr/local/share/ca-certificates && echo "$INTERNAL_ROOT_CA" >/usr/local/share/ca-certificates/internal_root_ca.crt && update-ca-certificates) || true

# Use puppeteer user for Chrome sandbox
USER pptruser
COPY package*.json ./
Expand All @@ -26,8 +31,8 @@ RUN npm ci
COPY . .
# Test source code
RUN npm test \
# Build source code
&& npm run build
# Build source code
&& npm run build

FROM base
# Install runtime dependencies
Expand Down

0 comments on commit a0ca82d

Please sign in to comment.