Skip to content

Commit 2305bfc

Browse files
Add dockerfile and .dockerignore for containerizing bytenotes web app.
- Added Dockerfile to containerize the Next.js application with Node 20.12.0 Alpine. - Configured Dockerfile to set up the environment, install dependencies, generate Prisma client, and build the application. - Added .dockerignore to exclude unnecessary files like node_modules, .next, .git, and environment files during the Docker build process.
1 parent 21e69a0 commit 2305bfc

File tree

3 files changed

+27
-0
lines changed

3 files changed

+27
-0
lines changed

.dockerignore

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
node_modules
2+
.next
3+
.git
4+
.env*

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ yarn-error.log*
2828
# local env files
2929
.env*.local
3030
.env
31+
docker.env
3132

3233
# vercel
3334
.vercel

docker/Dockerfile

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
FROM node:20.12.0-alpine3.19
2+
3+
WORKDIR /app
4+
5+
# Copy package.json and package-lock.json
6+
COPY package*.json yarn.lock tsconfig.json components.json next.config.mjs postcss.config.mjs tailwind.config.ts ./
7+
8+
COPY prisma ./prisma/
9+
10+
# Install dependencies
11+
RUN npm ci
12+
13+
RUN npx prisma generate
14+
15+
COPY . .
16+
17+
RUN npm run build
18+
19+
20+
EXPOSE 3000
21+
22+
CMD ["npm", "start"]

0 commit comments

Comments
 (0)