Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade Alpine, Puppeteer, & Chromium #402

Merged
merged 6 commits into from
Sep 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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