Skip to content

Commit

Permalink
Upgrade Alpine, Puppeteer, & Chromium (#402)
Browse files Browse the repository at this point in the history
* Upgrade to Alpine 3.20 and Puppeteer version

* Don't use ENV for branch value

* Don't use ENV var to detect distro

* Cleanup puppeteer dev profiles on exit. Resolves #396

* Fix zombie process cleanup. Resolves #401
  • Loading branch information
claabs authored Sep 22, 2024
1 parent 137584c commit b461b77
Show file tree
Hide file tree
Showing 10 changed files with 300 additions and 281 deletions.
7 changes: 3 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
########
# BASE
########
FROM node:18-alpine3.19 AS base
FROM node:18-alpine3.20 AS base

ENV DISTRO=alpine
ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=1

WORKDIR /usr/app
Expand All @@ -18,7 +17,7 @@ FROM base AS deps
# and note the Chromium version available. Then go to https://pptr.dev/chromium-support
# and find the latest version that supports that Chromium version, and update it in the package.json.
RUN apk add --no-cache \
'chromium=~124' \
'chromium=~128' \
ca-certificates \
ttf-freefont \
# App dependencies
Expand Down Expand Up @@ -63,7 +62,7 @@ ARG COMMIT_SHA="" \
BRANCH=""

# Put COMMIT_SHA in a file, since Docker managers like Portainer will not use updated ENVs
RUN echo $COMMIT_SHA > commit-sha.txt
RUN echo $COMMIT_SHA > commit-sha.txt && echo $BRANCH > branch.txt

LABEL org.opencontainers.image.title="epicgames-freegames-node" \
org.opencontainers.image.url="https://github.com/claabs/epicgames-freegames-node" \
Expand Down
9 changes: 4 additions & 5 deletions Dockerfile.debian
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
########
# BASE
########
FROM node:18-bookworm-slim as base
FROM node:18-bookworm-slim AS base

ENV DISTRO=debian
ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=1

WORKDIR /usr/app

########
# DEPS
########
FROM base as deps
FROM base AS deps

# The Google Chrome apt list only seems to provide the latest version, so version compatibility with puppeteer is questionable
RUN apt-get update \
Expand All @@ -37,7 +36,7 @@ RUN apt-get update \
########
# BUILD
########
FROM base as build
FROM base AS build

# Copy all source files
COPY package*.json tsconfig.json ./
Expand All @@ -53,7 +52,7 @@ RUN npm run build
########
# DEPLOY
########
FROM deps as deploy
FROM deps AS deploy

# Copy package.json for version number
COPY package*.json ./
Expand Down
4 changes: 4 additions & 0 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ if [ ! -e /etc/timezone ]; then
echo "$TZ" > /etc/timezone
fi

# Set the DISTRO variable
export DISTRO=$(grep '^ID=' /etc/os-release | cut -d'=' -f2)
echo "Detected distro: $DISTRO"

# If runOnStartup is set, run it once before setting up the schedule
echo "Run on startup: ${RUN_ON_STARTUP}"
if [ "$RUN_ON_STARTUP" = "true" ]; then
Expand Down
Loading

0 comments on commit b461b77

Please sign in to comment.