diff options
| author | Ve Ka <[email protected]> | 2023-08-07 17:32:15 +0800 |
|---|---|---|
| committer | GitHub <[email protected]> | 2023-08-07 16:32:15 +0700 |
| commit | 2419dd10df08631bd07bfc87e5692e1ae2ab3aa1 (patch) | |
| tree | 281fdb97e47d1cc613e0cb35b87438709f8e7c5e | |
| parent | Provide compatibility to Dockerfile (#33) (diff) | |
| download | moopa-2419dd10df08631bd07bfc87e5692e1ae2ab3aa1.tar.xz moopa-2419dd10df08631bd07bfc87e5692e1ae2ab3aa1.zip | |
Dockerfile for building moopa (#34)
* Provide compatibility to Dockerfile
* Create Dockerfile
| -rw-r--r-- | Dockerfile | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..d4f7d9c --- /dev/null +++ b/Dockerfile @@ -0,0 +1,27 @@ +FROM node:20-alpine AS base + +FROM base AS deps +RUN apk add --no-cache libc6-compat git +WORKDIR /app +RUN git clone https://github.com/Ani-Moopa/Moopa.git . +RUN rm -rf .git .gitignore .vscode LICENSE.md README.md +RUN npm install --verbose + +FROM base AS builder +ENV NEXT_TELEMETRY_DISABLED 1 +WORKDIR /app +COPY --from=deps --link /app/node_modules ./node_modules +COPY --from=deps /app . +RUN npm run build + +FROM base AS runner +ENV NEXT_TELEMETRY_DISABLED 1 +WORKDIR /app +RUN addgroup --system --gid 1001 nodejs; \ + adduser --system --uid 1001 nextjs +COPY --from=builder /app/public ./public +COPY --from=builder --chown=1001:1001 /app/.next/standalone ./ +COPY --from=builder --chown=1001:1001 /app/.next/static ./.next/static +USER nextjs +EXPOSE 3000 +CMD ["node", "server.js"] |