Kaynağa Gözat

修改部署文件

xueyiming 2 hafta önce
ebeveyn
işleme
5838be26fe
3 değiştirilmiş dosya ile 6 ekleme ve 3 silme
  1. 1 2
      Dockerfile
  2. 2 0
      docker-compose.yml
  3. 3 1
      frontend/Dockerfile

+ 1 - 2
Dockerfile

@@ -1,4 +1,4 @@
-FROM registry.cn-hangzhou.aliyuncs.com/stuuudy/python:3.11-slim AS base
+FROM docker.m.daocloud.io/library/python:3.11-slim AS base
 
 WORKDIR /app
 
@@ -7,7 +7,6 @@ RUN pip install --no-cache-dir --upgrade pip setuptools wheel -i https://mirrors
     && pip install --no-cache-dir -r requirements.txt -i https://mirrors.aliyun.com/pypi/simple/
 
 COPY app ./app
-COPY .env ./.env
 
 EXPOSE 8000
 CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8000"]

+ 2 - 0
docker-compose.yml

@@ -4,6 +4,8 @@ services:
       context: .
       dockerfile: Dockerfile
     container_name: demand_server_backend
+    env_file:
+      - .env
     ports:
       - "8000:8000"
     restart: unless-stopped

+ 3 - 1
frontend/Dockerfile

@@ -2,7 +2,9 @@ FROM node:20-alpine AS build
 WORKDIR /app
 
 COPY package.json ./
-RUN npm install
+COPY package-lock.json ./
+RUN npm config set registry https://registry.npmmirror.com \
+    && npm ci --no-audit --no-fund
 
 COPY . .
 RUN npm run build