File tree 3 files changed +25
-11
lines changed
3 files changed +25
-11
lines changed Original file line number Diff line number Diff line change @@ -4,10 +4,19 @@ WORKDIR /app
4
4
5
5
COPY package*.json ./
6
6
7
+ # Install dependencies
7
8
RUN npm install
8
9
10
+ # Copy application code
9
11
COPY . .
10
12
13
+ # Build the application
14
+ RUN npm run build
15
+
16
+ # Set production environment
17
+ ENV NODE_ENV=production
18
+
11
19
EXPOSE 3001
12
20
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:
7
7
dockerfile : Dockerfile
8
8
ports :
9
9
- " 3001:3001"
10
- volumes :
11
- - ./backend:/app
12
- - /app/node_modules
13
10
environment :
14
11
- PORT=3001
15
- - NODE_ENV=development
16
- command : npm run dev
12
+ - NODE_ENV=production
13
+ restart : unless-stopped
17
14
18
15
frontend :
19
16
build :
20
17
context : ./frontend
21
18
dockerfile : Dockerfile
22
19
ports :
23
20
- " 3000:3000"
24
- volumes :
25
- - ./frontend:/app
26
- - /app/node_modules
27
21
environment :
28
22
- NEXT_PUBLIC_API_URL=http://localhost:3001/api
23
+ - NODE_ENV=production
29
24
depends_on :
30
25
- 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
4
4
5
5
COPY package*.json ./
6
6
7
+ # Install dependencies
7
8
RUN npm install
8
9
10
+ # Copy application code
9
11
COPY . .
10
12
13
+ # Copy environment file
11
14
COPY .env-sample .env
12
15
16
+ # Build the application
17
+ RUN npm run build
18
+
19
+ # Set production environment
20
+ ENV NODE_ENV=production
21
+
13
22
EXPOSE 3000
14
23
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