dockerfile上传
Change-Id: If8ff4f54d96186806b36237cea34bad0fc1183bc
diff --git a/Dockerfile b/Dockerfile
new file mode 100644
index 0000000..127e3bc
--- /dev/null
+++ b/Dockerfile
@@ -0,0 +1,12 @@
+# 构建阶段
+FROM node:18 as build
+WORKDIR /app
+COPY package*.json ./
+RUN npm install
+COPY . .
+RUN npm run build
+
+# 生产阶段
+FROM nginx:alpine
+COPY --from=build /app/build /usr/share/nginx/html
+EXPOSE 80
\ No newline at end of file
diff --git a/nginx.conf b/nginx.conf
new file mode 100644
index 0000000..f159a2c
--- /dev/null
+++ b/nginx.conf
@@ -0,0 +1,18 @@
+server {
+ listen 80;
+ server_name localhost team11.10813352.xyz;
+
+ # 前端请求(React 静态资源)
+ location / {
+ root /usr/share/nginx/html; # React 构建文件默认位置
+ index index.html;
+ try_files $uri $uri/ /index.html; # 支持前端路由
+ }
+
+ # 后端 API 请求
+ location /echo {
+ proxy_pass http://backend:5011; # 转发到后端容器
+ proxy_set_header Host $host;
+ proxy_set_header X-Real-IP $remote_addr;
+ }
+}
\ No newline at end of file