File tree Expand file tree Collapse file tree 3 files changed +25
-11
lines changed
Expand file tree Collapse file tree 3 files changed +25
-11
lines changed Original file line number Diff line number Diff line change @@ -4,10 +4,19 @@ WORKDIR /app
44
55COPY package*.json ./
66
7+ # Install dependencies
78RUN npm install
89
10+ # Copy application code
911COPY . .
1012
13+ # Build the application
14+ RUN npm run build
15+
16+ # Set production environment
17+ ENV NODE_ENV=production
18+
1119EXPOSE 3001
1220
13- CMD ["npm" , "run" , "dev" ]
21+ # Run in production mode
22+ CMD ["npm" , "run" , "start" ]
Original file line number Diff line number Diff line change @@ -7,25 +7,20 @@ services:
77 dockerfile : Dockerfile
88 ports :
99 - " 3001:3001"
10- volumes :
11- - ./backend:/app
12- - /app/node_modules
1310 environment :
1411 - PORT=3001
15- - NODE_ENV=development
16- command : npm run dev
12+ - NODE_ENV=production
13+ restart : unless-stopped
1714
1815 frontend :
1916 build :
2017 context : ./frontend
2118 dockerfile : Dockerfile
2219 ports :
2320 - " 3000:3000"
24- volumes :
25- - ./frontend:/app
26- - /app/node_modules
2721 environment :
2822 - NEXT_PUBLIC_API_URL=http://localhost:3001/api
23+ - NODE_ENV=production
2924 depends_on :
3025 - backend
31- command : npm run dev
26+ restart : unless-stopped
Original file line number Diff line number Diff line change @@ -4,12 +4,22 @@ WORKDIR /app
44
55COPY package*.json ./
66
7+ # Install dependencies
78RUN npm install
89
10+ # Copy application code
911COPY . .
1012
13+ # Copy environment file
1114COPY .env-sample .env
1215
16+ # Build the application
17+ RUN npm run build
18+
19+ # Set production environment
20+ ENV NODE_ENV=production
21+
1322EXPOSE 3000
1423
15- CMD ["npm" , "run" , "dev" ]
24+ # Run in production mode
25+ CMD ["npm" , "run" , "start" ]
You can’t perform that action at this time.
0 commit comments