-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
👷 Add Dockerfile and GitHub action for building and pushing to GHCR
- Loading branch information
Showing
9 changed files
with
1,019 additions
and
901 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
FROM node:20.12.1-alpine as builder | ||
WORKDIR /app | ||
|
||
RUN apk add --no-cache libc6-compat | ||
|
||
COPY src ./src | ||
COPY public ./public | ||
COPY tsconfig.json tailwind.config.ts postcss.config.js next-env.d.ts next.config.mjs package.json package-lock.json .prettierrc.json .eslintrc.json ./ | ||
|
||
# Note - this cannot be run with NODE_ENV of production as it will not install dev dependencies | ||
RUN npm ci | ||
RUN npm run build | ||
|
||
FROM node:20.12.1-alpine as runner | ||
ENV NODE_ENV production | ||
WORKDIR /app | ||
|
||
RUN addgroup --system --gid 1001 nodejs | ||
RUN adduser --system --uid 1001 nextjs | ||
|
||
COPY --from=builder /app/public ./public | ||
|
||
RUN mkdir .next | ||
RUN chown nextjs:nodejs .next | ||
COPY --from=builder --chown=nextjs:nodejs /app/.next/standalone ./ | ||
COPY --from=builder --chown=nextjs:nodejs /app/.next/static ./.next/static | ||
|
||
USER nextjs | ||
|
||
EXPOSE 3000 | ||
|
||
ENV PORT 3000 | ||
ENV HOSTNAME "0.0.0.0" | ||
|
||
WORKDIR /app | ||
CMD ["node", "server.js"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
/** @type {import('next').NextConfig} */ | ||
const nextConfig = { | ||
output: 'export', | ||
output: 'standalone', | ||
}; | ||
|
||
export default nextConfig; |
Oops, something went wrong.