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 @@
1############################################################################### 1###############################################################################
2# A lightweight, non-root, multi-stage, cross-architecture Dockerfile # 2# A lightweight, non-root, multi-stage, cross-architecture Dockerfile #
3# That you can use in order to easily deploy Awesome Privacy to any server # 3# 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 #
5# Licensed under MIT (C) Alicia Sykes <https://aliciasykes.com> 2024 # 5# Licensed under MIT (C) Alicia Sykes <https://aliciasykes.com> 2024 #
6############################################################################### 6###############################################################################
7# Usage: # 7# Usage: #
@@ -15,18 +15,30 @@
15# Open your browser and navigate to http://127.0.0.1:8080 # 15# Open your browser and navigate to http://127.0.0.1:8080 #
16############################################################################### 16###############################################################################
17 17
18# Stage 1: Build the app (Alpine + Node.js) 18# Stage 1: Install deps
19# Copies manifest and src files from host, installs deps, and builds the app 19FROM node:24-alpine AS deps
20FROM node:16-alpine as build
21WORKDIR /app 20WORKDIR /app
22COPY package.json yarn.lock .env* ./ 21RUN corepack enable
23RUN yarn install --frozen-lockfile 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
24COPY . . 31COPY . .
32ENV DEPLOY_TARGET=node OUTPUT=static
25RUN yarn build 33RUN yarn build
26 34
27# Stage 2: Serve the app (Alpine + NGINX) 35# Stage 3: Production runtime (non-root, minimal)
28# Copies dist from the previous stage, exposes port 80, and starts web server 36FROM node:24-alpine AS runtime
29FROM nginx:alpine as runtime 37RUN addgroup -S app && adduser -S app -G app
30COPY --from=build /app/dist /usr/share/nginx/html 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
31EXPOSE 80 43EXPOSE 80
32CMD ["nginx", "-g", "daemon off;"] 44CMD ["node", "dist/server/entry.mjs"]