提交 dde80025 authored 作者: zhanglu's avatar zhanglu

v1 docker build

上级 ade792f7
......@@ -3,3 +3,4 @@ chunk_*.js
vendor.js
manifest.js
frontend/node_modules
.idea
\ No newline at end of file
__pycache__
*.pyc
*.pyo
.env
.venv
node_modules
tests
......
# Backend — Python 3.11 + FastAPI + uvicorn
FROM python:3.11-slim
FROM docker.1ms.run/python:3.11-slim
WORKDIR /app
WORKDIR /law_order
# Install dependencies
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
RUN pip install --no-cache-dir -r requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple
# Copy source
COPY main.py main.py
COPY app/ app/
COPY .env .env
# Create directories
RUN mkdir -p /app/data /app/logs
COPY app/ /law_order/app
COPY data/ /law_order/data
COPY logs/ /law_order/logs
COPY .env /law_order/.env
EXPOSE 8080
......
......@@ -7,3 +7,5 @@ requests==2.31.0
pycryptodome==3.19.0
apscheduler==3.10.4
aiohttp==3.9.1
PyJWT==2.10.1
bcrypt
\ No newline at end of file
# Frontend — build React + serve with Nginx
FROM node:20-alpine AS build
FROM docker.1ms.run/node:20-alpine AS build
WORKDIR /app
COPY package.json package-lock.json ./
......@@ -7,7 +7,7 @@ RUN npm ci --production=false
COPY . .
RUN npm run build
FROM nginx:alpine
FROM docker.1ms.run/nginx:alpine
COPY --from=build /app/dist /usr/share/nginx/html
COPY nginx/nginx.conf /etc/nginx/conf.d/default.conf
......
......@@ -13,7 +13,7 @@ server {
# Backend API proxy
location /api/ {
proxy_pass http://law_order_backend:8080;
proxy_pass http://192.168.0.143:8080;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
......@@ -23,7 +23,7 @@ server {
# WebSocket support (future SSE/log streaming)
location /ws/ {
proxy_pass http://law_order_backend:8080;
proxy_pass http://192.168.0.143:8080;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
......
Markdown 格式
0% 或
您添加了 0 人 到此讨论。请谨慎行事。
请先完成此评论的编辑!
请 注册 或者 后发表评论