Skip to content

Commit 7dcd4ff

Browse files
committed
Dockerfile with node-22
1 parent 4c6d9fd commit 7dcd4ff

File tree

2 files changed

+22
-30
lines changed

2 files changed

+22
-30
lines changed

Dockerfile

+16-25
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
# syntax=docker.io/docker/dockerfile:1
2-
3-
FROM node:18-alpine AS base
1+
FROM node:22-alpine AS base
42

53
# Install dependencies only when needed
64
FROM base AS deps
@@ -9,13 +7,8 @@ RUN apk add --no-cache libc6-compat
97
WORKDIR /app
108

119
# Install dependencies based on the preferred package manager
12-
COPY package.json yarn.lock* package-lock.json* pnpm-lock.yaml* .npmrc* ./
13-
RUN \
14-
if [ -f yarn.lock ]; then yarn --frozen-lockfile; \
15-
elif [ -f package-lock.json ]; then npm ci; \
16-
elif [ -f pnpm-lock.yaml ]; then corepack enable pnpm && pnpm i --frozen-lockfile; \
17-
else echo "Lockfile not found." && exit 1; \
18-
fi
10+
COPY package*.json ./
11+
RUN npm ci
1912

2013

2114
# Rebuild the source code only when needed
@@ -24,31 +17,29 @@ WORKDIR /app
2417
COPY --from=deps /app/node_modules ./node_modules
2518
COPY . .
2619

27-
# Next.js collects completely anonymous telemetry data about general usage.
28-
# Learn more here: https://nextjs.org/telemetry
29-
# Uncomment the following line in case you want to disable telemetry during the build.
30-
# ENV NEXT_TELEMETRY_DISABLED=1
20+
ENV NEXT_TELEMETRY_DISABLED=1
3121

32-
RUN \
33-
if [ -f yarn.lock ]; then yarn run build; \
34-
elif [ -f package-lock.json ]; then npm run build; \
35-
elif [ -f pnpm-lock.yaml ]; then corepack enable pnpm && pnpm run build; \
36-
else echo "Lockfile not found." && exit 1; \
37-
fi
22+
RUN npm run build
3823

39-
# Production image, copy all the files and run next
4024
FROM base AS runner
4125
WORKDIR /app
4226

43-
#ENV NODE_ENV=production
44-
# Uncomment the following line in case you want to disable telemetry during runtime.
45-
# ENV NEXT_TELEMETRY_DISABLED=1
27+
ARG COMMIT="(not set)"
28+
ARG LASTMOD="(not set)"
29+
ENV COMMIT=$COMMIT
30+
ENV LASTMOD=$LASTMOD
31+
ENV NODE_ENV=production
32+
ENV NEXT_TELEMETRY_DISABLED=1
4633

4734
RUN addgroup --system --gid 1001 nodejs
4835
RUN adduser --system --uid 1001 nextjs
4936

5037
COPY --from=builder /app/public ./public
5138

39+
# Set the correct permission for prerender cache
40+
RUN mkdir .next
41+
RUN chown nextjs:nodejs .next
42+
5243
# Automatically leverage output traces to reduce image size
5344
# https://nextjs.org/docs/advanced-features/output-file-tracing
5445
COPY --from=builder --chown=nextjs:nodejs /app/.next/standalone ./
@@ -61,6 +52,6 @@ EXPOSE 3000
6152
ENV PORT=3000
6253

6354
# server.js is created by next build from the standalone output
64-
# https://nextjs.org/docs/pages/api-reference/config/next-config-js/output
55+
# https://nextjs.org/docs/pages/api-reference/next-config-js/output
6556
ENV HOSTNAME="0.0.0.0"
6657
CMD ["node", "server.js"]

README.md

+6-5
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Outline Viewer [<img alt="Outline Viewer logo" src="public/favicon.svg" height="90" align="right" />](https://opml.xml.style/)
1+
# OPML Outline Viewer [<img alt="Outline Viewer logo" src="public/favicon.svg" height="90" align="right" />](https://opml.xml.style/)
22

33
[![NodePing status](https://img.shields.io/nodeping/status/O0XVZ8N8-AB6K-4DZG-80XJ-5P7F7HP3DCMG?label=Current%20status)](https://nodeping.com/reports/checks/O0XVZ8N8-AB6K-4DZG-80XJ-5P7F7HP3DCMG)
44
[![NodePing uptime](https://img.shields.io/nodeping/uptime/O0XVZ8N8-AB6K-4DZG-80XJ-5P7F7HP3DCMG?label=30-day%20uptime)](https://nodeping.com/reports/uptime/O0XVZ8N8-AB6K-4DZG-80XJ-5P7F7HP3DCMG)
@@ -37,13 +37,14 @@ This is a graphical viewer for `opml.xml` outlines. Try it at [opml.xml.style](
3737

3838
## To Do
3939

40+
- [ ] option to link xmlUrl to analyzer and/or validator
41+
- [ ] cleanup demo.xml
4042
- [ ] structured logging
41-
- [ ] custom xml namespace: open/closed, allopen, style, title
42-
- [ ] label transforms: do not change if custom label
43-
- [ ] sort option `homefirst` to be name, but "Home" at top
43+
- [ ] handle html labels (optionally)
44+
- [ ] open nodes based on `expansionState`
45+
- [ ] initial scroll based on `vertScrollState`
4446
- [ ] "report an issue" in footer of debug dialog (link to GH issues)
4547
- [ ] test/cleanup error pages
46-
- [ ] use favicon (or custom icon) in navbar (instead of MdMap)
4748
- [ ] better 404 page formatting
4849
- [ ] customize initial light/dark mode (or maybe not?)
4950
- [ ] customize initial language (or maybe not?)

0 commit comments

Comments
 (0)