Skip to content
Open
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
31 changes: 15 additions & 16 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,13 @@ RUN cp /code/OpenBullet2.Web/dbip-country-lite.mmdb /build
# --------
# FRONTEND
# --------
FROM node:20.9.0 AS frontend
FROM node:22-bookworm-slim AS frontend

WORKDIR /code

COPY openbullet2-web-client/package.json .
COPY openbullet2-web-client/package-lock.json .
RUN npm install
RUN npm ci

COPY openbullet2-web-client .
RUN npm run build
Expand All @@ -50,20 +50,19 @@ COPY --from=backend /build/web .
COPY --from=frontend /build ./wwwroot
COPY OpenBullet2.Web/dbip-country-lite.mmdb .

# Install dependencies
RUN apt-get update -yq && apt-get install -y --no-install-recommends apt-utils
RUN apt-get upgrade -yq && apt-get install -yq apt-utils curl git nano wget unzip python3 python3-pip

# Setup nodejs
RUN curl -sL https://deb.nodesource.com/setup_current.x | bash - && apt-get install -yq nodejs build-essential
RUN echo "deb http://deb.debian.org/debian/ unstable main contrib non-free" >> /etc/apt/sources.list.d/debian.list

# Install chromium and firefox for selenium and puppeteer
RUN apt-get update -yq && apt-get install -y --no-install-recommends firefox chromium
RUN pip3 install webdrivermanager || true
RUN webdrivermanager firefox chrome --linkpath /usr/local/bin || true

RUN apt-get clean && rm -rf /var/lib/apt/lists/*
# Install dependencies and Node.js in a single layer to reduce image size
RUN apt-get update -yq \
&& apt-get install -y --no-install-recommends \
apt-utils curl git nano wget unzip \
python3 \
nodejs npm \
chromium firefox-esr \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*

# Note: Selenium 4.6+ includes Selenium Manager which automatically
# downloads the correct browser drivers at runtime. No need for
# the deprecated webdrivermanager pip package.

EXPOSE 5000
CMD ["dotnet", "./OpenBullet2.Web.dll", "--urls=http://*:5000"]
4 changes: 2 additions & 2 deletions Dockerfile.build
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,13 @@ RUN cp /code/OpenBullet2.Web/dbip-country-lite.mmdb /build
# --------
# FRONTEND
# --------
FROM node:20.9.0 AS frontend
FROM node:22-bookworm-slim AS frontend

WORKDIR /code

COPY openbullet2-web-client/package.json .
COPY openbullet2-web-client/package-lock.json .
RUN npm install
RUN npm ci

COPY openbullet2-web-client .
RUN npm run build
Expand Down
37 changes: 10 additions & 27 deletions Dockerfile.remote
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ FROM mcr.microsoft.com/dotnet/aspnet:8.0-bookworm-slim

ENV DEBIAN_FRONTEND=noninteractive

# Install basic dependencies
# Install dependencies, Node.js, and browsers in a single layer
RUN apt-get update -yq \
&& apt-get install -y --no-install-recommends \
apt-utils \
Expand All @@ -12,32 +12,15 @@ RUN apt-get update -yq \
wget \
unzip \
python3 \
python3-pip \
gnupg \
lsb-release \
software-properties-common

# Setup Node.js (LTS Version)
RUN curl -sL https://deb.nodesource.com/setup_lts.x | bash - \
&& apt-get install -yq nodejs build-essential

# Add Mozilla Team PPA for the latest Firefox
RUN echo "deb http://ppa.launchpad.net/mozillateam/ppa/ubuntu focal main" | tee /etc/apt/sources.list.d/mozillateam-ppa.list \
&& apt-key adv --keyserver keyserver.ubuntu.com --recv-keys A6DCF7707EBC211F \
&& apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 9BDB3D89CE49EC21 \
&& apt-get update -yq

# Install the latest Firefox and Chromium
RUN apt-get install -y --no-install-recommends \
firefox \
chromium

# Install WebDriverManager
RUN pip3 install webdrivermanager || true \
&& webdrivermanager firefox chrome --linkpath /usr/local/bin || true

# Clean up
RUN apt-get clean && rm -rf /var/lib/apt/lists/*
nodejs npm \
chromium \
firefox-esr \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*

# Note: Selenium 4.6+ includes Selenium Manager which automatically
# downloads the correct browser drivers at runtime. No need for
# the deprecated webdrivermanager pip package.

WORKDIR /app

Expand Down