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

update code

Browse files
Files changed (2) hide show
  1. Dockerfile +4 -13
  2. nginx.conf +0 -10
Dockerfile CHANGED
@@ -1,14 +1,5 @@
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;"]
 
1
+ FROM node:18
 
2
  WORKDIR /app
3
+ COPY build/ .
4
+ RUN npm install -g serve
5
+ CMD ["serve", "-s", ".", "-l", "3000"]
 
 
 
 
 
 
 
 
nginx.conf DELETED
@@ -1,10 +0,0 @@
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
- }