PhamDinhPhong commited on
Commit
5ea51fa
·
1 Parent(s): b9780a1

update like deepseek

Browse files
Files changed (2) hide show
  1. Dockerfile +7 -11
  2. nginx.conf +7 -33
Dockerfile CHANGED
@@ -1,18 +1,14 @@
1
- FROM node:18 AS build
2
-
3
  WORKDIR /app
4
-
5
  COPY package*.json ./
6
  RUN npm install
7
-
8
  COPY . .
9
  RUN npm run build
10
 
11
- FROM nginxinc/nginx-unprivileged:1.25-alpine
12
-
13
  COPY --from=build /app/build /usr/share/nginx/html
14
-
15
- COPY nginx.conf /etc/nginx/nginx.conf
16
-
17
- EXPOSE 8080
18
- CMD ["nginx", "-g", "daemon off;"]
 
1
+ # Giai đoạn build React
2
+ FROM node:18 as build
3
  WORKDIR /app
 
4
  COPY package*.json ./
5
  RUN npm install
 
6
  COPY . .
7
  RUN npm run build
8
 
9
+ # Giai đoạn chạy Nginx
10
+ FROM nginx:alpine
11
  COPY --from=build /app/build /usr/share/nginx/html
12
+ COPY nginx.conf /etc/nginx/conf.d/default.conf
13
+ EXPOSE 80
14
+ CMD ["nginx", "-g", "daemon off;"]
 
 
nginx.conf CHANGED
@@ -1,36 +1,10 @@
1
- worker_processes 1;
2
-
3
- events {
4
- worker_connections 1024;
5
- }
6
-
7
- http {
8
- include /etc/nginx/mime.types;
9
- default_type application/octet-stream;
10
-
11
- sendfile on;
12
-
13
- client_body_temp_path /tmp/client_temp;
14
- proxy_temp_path /tmp/proxy_temp;
15
- fastcgi_temp_path /tmp/fastcgi_temp;
16
- uwsgi_temp_path /tmp/uwsgi_temp;
17
- scgi_temp_path /tmp/scgi_temp;
18
-
19
- server {
20
- listen 8080;
21
- server_name localhost;
22
 
 
23
  root /usr/share/nginx/html;
24
- index index.html;
25
-
26
- location / {
27
- try_files $uri $uri/ /index.html;
28
- }
29
-
30
- location /assets/ {
31
- add_header Cache-Control "no-store";
32
- }
33
-
34
- error_page 404 /index.html;
35
  }
36
- }
 
1
+ server {
2
+ listen 80;
3
+ server_name localhost;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4
 
5
+ location / {
6
  root /usr/share/nginx/html;
7
+ index index.html index.htm;
8
+ try_files $uri $uri/ /index.html;
 
 
 
 
 
 
 
 
 
9
  }
10
+ }