Skip to content

Commit 3f58eb5

Browse files
committed
Create docker for frontend
1 parent ed3cca5 commit 3f58eb5

File tree

2 files changed

+34
-0
lines changed

2 files changed

+34
-0
lines changed

frontend/Dockerfile

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Use an official Node.js runtime as the base image
2+
FROM node:20-alpine
3+
4+
# Set the working directory in the container
5+
WORKDIR /app
6+
7+
# Copy the package.json and package-lock.json files
8+
COPY package*.json ./
9+
10+
# Install dependencies
11+
RUN npm install
12+
13+
# Copy the rest of the application code
14+
COPY . .
15+
16+
# Expose the port the app runs on (default is 3000 for Next.js)
17+
EXPOSE 3000
18+
19+
# Start Next.js in development mode with hot-reloading
20+
CMD ["npm", "run", "dev"]

frontend/docker-compose.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
version: "3"
2+
services:
3+
app:
4+
build:
5+
context: .
6+
dockerfile: Dockerfile
7+
volumes:
8+
- .:/app
9+
- /app/node_modules
10+
ports:
11+
- "3000:3000"
12+
environment:
13+
- NODE_ENV=development
14+
command: npm run dev

0 commit comments

Comments
 (0)