Spaces:
Runtime error
Runtime error
PhamDinhPhong commited on
Commit ·
251dc98
1
Parent(s): 5ea51fa
update code
Browse files- Dockerfile +4 -13
- nginx.conf +0 -10
Dockerfile
CHANGED
|
@@ -1,14 +1,5 @@
|
|
| 1 |
-
|
| 2 |
-
FROM node:18 as build
|
| 3 |
WORKDIR /app
|
| 4 |
-
COPY
|
| 5 |
-
RUN npm install
|
| 6 |
-
|
| 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 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|