Skip to content

Commit

Permalink
Update Dockerfile, blog.config.js, and next.config.js
Browse files Browse the repository at this point in the history
  • Loading branch information
robinv8 committed Jan 2, 2024
1 parent 03a448b commit 2c78fa9
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 16 deletions.
19 changes: 5 additions & 14 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,25 +1,16 @@
FROM node:18-alpine
FROM node:16-alpine
WORKDIR /app

ENV NODE_ENV production
# Uncomment the following line in case you want to disable telemetry during runtime.
# ENV NEXT_TELEMETRY_DISABLED 1

RUN addgroup --system --gid 1001 nodejs
RUN adduser --system --uid 1001 nextjs
COPY .next/standalone ./

COPY /app/public ./public
COPY public ./public
COPY package.json ./package.json

# Set the correct permission for prerender cache
RUN mkdir .next
RUN chown nextjs:nodejs .next

# Automatically leverage output traces to reduce image size
# https://nextjs.org/docs/advanced-features/output-file-tracing
COPY --chown=nextjs:nodejs /app/.next/standalone ./
COPY --chown=nextjs:nodejs /app/.next/static ./.next/static

USER nextjs
COPY .next/static ./.next/static

EXPOSE 3000

Expand Down
2 changes: 1 addition & 1 deletion blog.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const BLOG = {
email: 'robin@rnode.me',
link: 'https://blog.robin.me',
newsletter: 'Weekly',
description: 'A static blog build on top of Notion and Next.js',
description: 'robin blog',
lang: 'zh-CN', // ['en-US', 'zh-CN', 'zh-HK', 'zh-TW', 'ja-JP', 'es-ES']
timezone: 'Asia/Shanghai', // See https://en.wikipedia.org/wiki/List_of_tz_database_time_zones for all options.
appearance: 'auto', // ['light', 'dark', 'auto'],
Expand Down
3 changes: 2 additions & 1 deletion next.config.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
module.exports = {
i18n: {
locales: ['en', 'zh'],
defaultLocale: 'en',
defaultLocale: 'zh',
localeDetection: false
},
transpilePackages: ['dayjs'],
images: {
domains: ['api.craft.do', 'www.notion.so', 'images.unsplash.com', 's3.us-west-2.amazonaws.com']
},
output: "standalone",
async headers() {
return [
{
Expand Down

0 comments on commit 2c78fa9

Please sign in to comment.