mirror of
https://github.com/coollabsio/coolify-examples.git
synced 2026-02-20 22:38:58 +00:00
new examples
This commit is contained in:
34
node/nextjs/ssr/.coolpack/Dockerfile
Normal file
34
node/nextjs/ssr/.coolpack/Dockerfile
Normal file
@@ -0,0 +1,34 @@
|
||||
# syntax=docker/dockerfile:1
|
||||
# Generated by Coolpack
|
||||
# Provider: node, Framework: nextjs, Output: server
|
||||
|
||||
FROM node:24-slim AS builder
|
||||
WORKDIR /app
|
||||
|
||||
COPY package.json package-lock.json* ./
|
||||
|
||||
RUN --mount=type=cache,target=/root/.npm npm ci
|
||||
|
||||
COPY . .
|
||||
|
||||
RUN --mount=type=cache,target=/app/.next/cache --mount=type=cache,target=/app/node_modules/.cache npm run build
|
||||
|
||||
FROM node:24-slim AS runner
|
||||
WORKDIR /app
|
||||
|
||||
RUN addgroup --system --gid 1001 coolgroup && \
|
||||
adduser --system --uid 1001 --ingroup coolgroup cooluser
|
||||
|
||||
ENV NODE_ENV=production
|
||||
|
||||
COPY --from=builder /app/node_modules ./node_modules
|
||||
COPY --from=builder /app/.next ./.next
|
||||
COPY --from=builder /app/public ./public
|
||||
COPY --from=builder /app/package.json ./
|
||||
|
||||
RUN chown -R cooluser:coolgroup /app
|
||||
USER cooluser
|
||||
|
||||
EXPOSE 3000
|
||||
|
||||
CMD ["npm", "run", "start"]
|
||||
Reference in New Issue
Block a user