Compare commits
6 Commits
c7354aee85
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
bf2ef37f49 | ||
|
|
9a2b5f57ed | ||
|
|
9a0886817a | ||
|
|
88add102be | ||
|
|
4c4b604814 | ||
|
|
f714a0a942 |
7
.dockerignore
Normal file
7
.dockerignore
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
node_modules
|
||||||
|
.next
|
||||||
|
.git
|
||||||
|
.gitignore
|
||||||
|
Dockerfile
|
||||||
|
README.md
|
||||||
|
.env*
|
||||||
88
Dockerfile
88
Dockerfile
@@ -1,59 +1,69 @@
|
|||||||
|
# --------------------------------
|
||||||
|
# Base
|
||||||
|
# --------------------------------
|
||||||
FROM node:20-alpine AS base
|
FROM node:20-alpine AS base
|
||||||
|
|
||||||
# Install dependencies only when needed
|
|
||||||
FROM base AS deps
|
|
||||||
RUN apk add --no-cache libc6-compat curl
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
RUN apk add --no-cache libc6-compat
|
||||||
|
|
||||||
|
|
||||||
|
# --------------------------------
|
||||||
|
# Dependencies
|
||||||
|
# --------------------------------
|
||||||
|
FROM base AS deps
|
||||||
|
|
||||||
# Install Bun
|
# Install Bun
|
||||||
RUN npm install -g bun
|
RUN npm install -g bun
|
||||||
|
|
||||||
# Install dependencies based on the preferred package manager
|
# Copy package files
|
||||||
COPY package.json yarn.lock* package-lock.json* pnpm-lock.yaml* bun.lock* ./
|
COPY package.json bun.lockb* ./
|
||||||
RUN \
|
|
||||||
if [ -f bun.lock ]; then bun install --frozen-lockfile; \
|
# Install dependencies
|
||||||
elif [ -f yarn.lock ]; then yarn --frozen-lockfile; \
|
RUN bun install --frozen-lockfile
|
||||||
elif [ -f package-lock.json ]; then npm ci; \
|
|
||||||
elif [ -f pnpm-lock.yaml ]; then corepack enable pnpm && pnpm i --frozen-lockfile; \
|
|
||||||
else echo "Lockfile not found." && exit 1; \
|
|
||||||
fi
|
|
||||||
|
|
||||||
|
|
||||||
# Rebuild the source code only when needed
|
# --------------------------------
|
||||||
|
# Builder
|
||||||
|
# --------------------------------
|
||||||
FROM base AS builder
|
FROM base AS builder
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
|
RUN npm install -g bun
|
||||||
|
|
||||||
COPY --from=deps /app/node_modules ./node_modules
|
COPY --from=deps /app/node_modules ./node_modules
|
||||||
COPY . .
|
COPY . .
|
||||||
|
|
||||||
# Next.js collects completely anonymous telemetry data about general usage.
|
ENV NEXT_TELEMETRY_DISABLED=1
|
||||||
# Learn more here: https://nextjs.org/telemetry
|
|
||||||
# Uncomment the following line in case you want to disable telemetry during the build.
|
|
||||||
ENV NEXT_TELEMETRY_DISABLED 1
|
|
||||||
|
|
||||||
# Install Bun for build stage if needed (depending on script)
|
# --- Algolia build args (Coolify injects these) ---
|
||||||
RUN npm install -g bun
|
ARG NEXT_PUBLIC_ALGOLIA_DOCSEARCH_APP_ID
|
||||||
|
ARG NEXT_PUBLIC_ALGOLIA_DOCSEARCH_API_KEY
|
||||||
|
ARG NEXT_PUBLIC_ALGOLIA_DOCSEARCH_INDEX_NAME
|
||||||
|
|
||||||
RUN \
|
ENV NEXT_PUBLIC_ALGOLIA_DOCSEARCH_APP_ID=$NEXT_PUBLIC_ALGOLIA_DOCSEARCH_APP_ID
|
||||||
if [ -f bun.lock ]; then bun run build; \
|
ENV NEXT_PUBLIC_ALGOLIA_DOCSEARCH_API_KEY=$NEXT_PUBLIC_ALGOLIA_DOCSEARCH_API_KEY
|
||||||
else npm run build; \
|
ENV NEXT_PUBLIC_ALGOLIA_DOCSEARCH_INDEX_NAME=$NEXT_PUBLIC_ALGOLIA_DOCSEARCH_INDEX_NAME
|
||||||
fi
|
|
||||||
|
|
||||||
# Production image, copy all the files and run next
|
# Build Next.js
|
||||||
FROM base AS runner
|
RUN bun run build
|
||||||
|
|
||||||
|
|
||||||
|
# --------------------------------
|
||||||
|
# Runner
|
||||||
|
# --------------------------------
|
||||||
|
FROM node:20-alpine AS runner
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
ENV NODE_ENV production
|
RUN apk add --no-cache curl libc6-compat
|
||||||
# Uncomment the following line in case you want to disable telemetry during runtime.
|
|
||||||
ENV NEXT_TELEMETRY_DISABLED 1
|
|
||||||
|
|
||||||
# Don't run as root
|
ENV NODE_ENV=production
|
||||||
RUN addgroup --system --gid 1001 nodejs
|
ENV NEXT_TELEMETRY_DISABLED=1
|
||||||
RUN adduser --system --uid 1001 nextjs
|
|
||||||
|
|
||||||
|
# Create non-root user
|
||||||
|
RUN addgroup --system --gid 1001 nodejs \
|
||||||
|
&& adduser --system --uid 1001 nextjs
|
||||||
|
|
||||||
|
# Copy standalone build
|
||||||
COPY --from=builder /app/public ./public
|
COPY --from=builder /app/public ./public
|
||||||
|
|
||||||
# Automatically leverage output traces to reduce image size
|
|
||||||
# https://nextjs.org/docs/advanced-features/output-file-tracing
|
|
||||||
COPY --from=builder --chown=nextjs:nodejs /app/.next/standalone ./
|
COPY --from=builder --chown=nextjs:nodejs /app/.next/standalone ./
|
||||||
COPY --from=builder --chown=nextjs:nodejs /app/.next/static ./.next/static
|
COPY --from=builder --chown=nextjs:nodejs /app/.next/static ./.next/static
|
||||||
|
|
||||||
@@ -61,9 +71,7 @@ USER nextjs
|
|||||||
|
|
||||||
EXPOSE 3000
|
EXPOSE 3000
|
||||||
|
|
||||||
ENV PORT 3000
|
ENV PORT=3000
|
||||||
# set hostname to localhost
|
ENV HOSTNAME=0.0.0.0
|
||||||
ENV HOSTNAME "0.0.0.0"
|
|
||||||
|
|
||||||
CMD ["node", "server.js"]
|
|
||||||
|
|
||||||
|
CMD ["node", "server.js"]
|
||||||
20
docu.json
20
docu.json
@@ -235,6 +235,14 @@
|
|||||||
"title": "Overview",
|
"title": "Overview",
|
||||||
"href": "/overview"
|
"href": "/overview"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"title": "Store Owner",
|
||||||
|
"href": "/store-owner"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"title": "Software Updates",
|
||||||
|
"href": "/software-updates"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"title": "addons",
|
"title": "addons",
|
||||||
"href": "/addons",
|
"href": "/addons",
|
||||||
@@ -246,7 +254,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"title": "Module Integration",
|
"title": "Module Integration",
|
||||||
"href": "/module-Integration"
|
"href": "/module-integration"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"title": "React Integration",
|
"title": "React Integration",
|
||||||
@@ -272,16 +280,6 @@
|
|||||||
"href": "/licensing"
|
"href": "/licensing"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
|
||||||
{
|
|
||||||
"title": "Software Updates",
|
|
||||||
"href": "/software-updates",
|
|
||||||
"items": [
|
|
||||||
{
|
|
||||||
"title": "Store Owner",
|
|
||||||
"href": "/store-owner"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
|||||||
Binary file not shown.
|
Before Width: | Height: | Size: 78 KiB After Width: | Height: | Size: 77 KiB |
Reference in New Issue
Block a user