Commit be21eba931

be21eba9316eb8c461eed8cbc60442da6dfb8b69

parent: fd51ad6573

Unsigned

Alicia Sykes <alicia@omg.lol> · 2026-04-17 00:14 UTC

Updates Dockerfile to node24 alpine

Layout: unified · split

web/Dockerfile +23 −11
@@ -1,7 +1,7 @@
11###############################################################################
22# A lightweight, non-root, multi-stage, cross-architecture Dockerfile #
33# That you can use in order to easily deploy Awesome Privacy to any server #
4# For docs visit the GitHub repo: https://github.com/lissy93/awesome-privacy #
4# For docs visit the GitHub repo: https://github.com/lissy93/awesome-privacy #
55# Licensed under MIT (C) Alicia Sykes <https://aliciasykes.com> 2024 #
66###############################################################################
77# Usage: #
@@ -15,18 +15,30 @@
1515# Open your browser and navigate to http://127.0.0.1:8080 #
1616###############################################################################
1717
18# Stage 1: Build the app (Alpine + Node.js)
19# Copies manifest and src files from host, installs deps, and builds the app
20FROM node:16-alpine as build
18# Stage 1: Install deps
19FROM node:24-alpine AS deps
2120WORKDIR /app
22COPY package.json yarn.lock .env* ./
23RUN yarn install --frozen-lockfile
21RUN corepack enable
22COPY package.json yarn.lock .yarnrc.yml ./
23COPY .yarn .yarn
24RUN yarn install --immutable
25
26# Stage 2: Build the site (SSG + standalone Node server)
27FROM node:24-alpine AS build
28WORKDIR /app
29RUN corepack enable
30COPY --from=deps /app/node_modules ./node_modules
2431COPY . .
32ENV DEPLOY_TARGET=node OUTPUT=static
2533RUN yarn build
2634
27# Stage 2: Serve the app (Alpine + NGINX)
28# Copies dist from the previous stage, exposes port 80, and starts web server
29FROM nginx:alpine as runtime
30COPY --from=build /app/dist /usr/share/nginx/html
35# Stage 3: Production runtime (non-root, minimal)
36FROM node:24-alpine AS runtime
37RUN addgroup -S app && adduser -S app -G app
38WORKDIR /app
39COPY --from=build --chown=app:app /app/dist ./dist
40COPY --from=deps --chown=app:app /app/node_modules ./node_modules
41USER app
42ENV HOST=0.0.0.0 PORT=80
3143EXPOSE 80
32CMD ["nginx", "-g", "daemon off;"]
44CMD ["node", "dist/server/entry.mjs"]