-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a27312e
commit f78b53b
Showing
33 changed files
with
1,743 additions
and
334 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,4 +2,6 @@ node_modules | |
.git | ||
.gitignore | ||
.env.example | ||
.env | ||
.env | ||
.next | ||
node_modules |
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,2 +1,4 @@ | ||
node_modules | ||
.next | ||
out | ||
.github |
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,10 @@ | ||
module.exports = { | ||
extends: [ | ||
"next/core-web-vitals", | ||
|
||
], | ||
plugins: ['@typescript-eslint'], | ||
rules: { | ||
'no-multiple-empty-lines': ['error', { max: 1 }], | ||
}, | ||
}; |
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
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,67 @@ | ||
# Stage 1: Build the application | ||
FROM node:20-alpine AS builder | ||
ARG DATABASE_URL | ||
ENV DATABASE_URL=${DATABASE_URL} | ||
|
||
WORKDIR /usr/src/app | ||
|
||
# Install pnpm globally | ||
RUN npm install -g pnpm | ||
|
||
# Copy package.json and pnpm-lock.yaml (if you have one) | ||
COPY package.json pnpm-lock.yaml* ./ | ||
|
||
# Copy Prisma schema | ||
COPY prisma ./prisma | ||
|
||
# Install dependencies including dev dependencies | ||
RUN pnpm install | ||
|
||
# Generate Prisma client | ||
RUN npx prisma generate --schema=./prisma/schema.prisma | ||
|
||
# Copy the rest of the application code | ||
COPY . . | ||
|
||
# Install next globally | ||
RUN npm install -g next | ||
|
||
# Copy ESLint configuration | ||
COPY .eslintrc.js . | ||
COPY .eslintignore . | ||
|
||
# Build the application | ||
RUN pnpm run lint || true && pnpm run build | ||
|
||
# Stage 2: Create the production image | ||
FROM node:20-alpine | ||
ARG DATABASE_URL | ||
|
||
WORKDIR /usr/src/app | ||
|
||
# Install pnpm globally | ||
RUN npm install -g pnpm | ||
|
||
# Copy package.json and pnpm-lock.yaml (if you have one) | ||
COPY package.json pnpm-lock.yaml* ./ | ||
|
||
# Install only production dependencies | ||
RUN pnpm install --prod --no-frozen-lockfile | ||
|
||
# Copy Prisma schema and generate client | ||
COPY prisma ./prisma | ||
RUN npx prisma generate --schema=./prisma/schema.prisma | ||
|
||
# Copy built application from the builder stage | ||
COPY --from=builder /usr/src/app/.next ./.next | ||
COPY --from=builder /usr/src/app/public ./public | ||
|
||
# Set environment variables | ||
ENV NODE_ENV=production | ||
ENV DATABASE_URL=${DATABASE_URL} | ||
|
||
# Expose the port the app runs on | ||
EXPOSE 3000 | ||
|
||
# Start the application | ||
CMD ["pnpm", "start"] |
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,5 +1,6 @@ | ||
FROM node:20-alpine | ||
ARG DATABASE_URL | ||
ENV DATABASE_URL=${DATABASE_URL} | ||
|
||
WORKDIR /usr/src/app | ||
|
||
|
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
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
Oops, something went wrong.