Skip to content

Commit e8ebe8e

Browse files
authored
Merge pull request #37 from WorkTechDevelop/settings-check
Update Dockerfile to build Next.js app with export command; modify Ng…
2 parents 0c7d9e8 + fdffcc4 commit e8ebe8e

File tree

3 files changed

+14
-18
lines changed

3 files changed

+14
-18
lines changed

Dockerfile

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
1+
# Сборка
12
FROM node:20-alpine AS builder
2-
WORKDIR /app
33

4+
WORKDIR /app
45
COPY package*.json ./
5-
66
RUN npm install
77

88
COPY . .
99

10-
RUN npm run build
10+
RUN npm run build && npm run export
1111

12+
# Продакшн
1213
FROM nginx:stable-alpine
13-
COPY --from=builder /app/build /usr/share/nginx/html
1414

15+
COPY --from=builder /app/out /usr/share/nginx/html
1516
COPY nginx.conf /etc/nginx/conf.d/default.conf
1617

1718
EXPOSE 80
18-
19-
CMD ["nginx", "-g", "daemon off;"]
19+
CMD ["nginx", "-g", "daemon off;"]

nginx.conf

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,10 @@
11
server {
22
listen 80;
3-
43
server_name localhost;
54

65
root /usr/share/nginx/html;
7-
index index.html;
86

97
location / {
10-
try_files $uri /index.html;
8+
try_files $uri $uri/ /index.html;
119
}
12-
13-
error_page 404 /index.html;
14-
}
10+
}

package.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@
33
"version": "0.1.0",
44
"private": true,
55
"scripts": {
6-
"dev": "next dev",
7-
"build": "next build",
8-
"export": "next export",
9-
"start": "next start -p 3000",
10-
"lint": "next lint"
11-
},
6+
"dev": "next dev",
7+
"build": "next build",
8+
"start": "next start",
9+
"export": "next export",
10+
"lint": "next lint"
11+
},
1212

1313
"dependencies": {
1414
"@hello-pangea/dnd": "^17.0.0",

0 commit comments

Comments
 (0)