File size: 1,368 Bytes
d988ae4
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
services:
  frontend:
    restart: unless-stopped
    image: node:18-alpine
    working_dir: /app
    volumes:
      - ./apps/frontend:/app
    ports:
      # 外部访问 clip.zeabur.app:8080 -> 宿主 8080 -> 容器 3000
      - "3000:3000"
    environment:
      - NEXT_PUBLIC_URL=http://20.63.225.23:3000
      - PUBLIC_SOCKET_URL=http://20.63.225.23:3001
      # 后端在容器网络里依然通过服务名访问,不用改
      - DOCKER_BACKEND_URL=http://backend:3001
      - NODE_ENV=production
    command: sh -c "npm i -g pnpm && pnpm install && pnpm run build && pnpm start"
    depends_on:
      - backend
    networks:
      - app-network

  backend:
    restart: unless-stopped
    image: node:18-alpine
    working_dir: /app
    volumes:
      - ./apps/backend:/app
      - ./uploads:/app/uploads # Mount uploads directory for file storage
    ports:
      - "3001:3001" # This port must be exported and accessed by the frontend for the socket connection
    environment:
      - REDIS_HOST=sjc1.clusters.zeabur.com
      - REDIS_PORT=24122
      - REDIS_PASSWORD=DjJd9reClM4T2BiqRoF56IZbNGV07138
      - ADMIN_TOKEN=admintoken11451421422
    command: sh -c "npm i -g pnpm && pnpm install && pnpm run start"
    networks:
      - app-network
      - storage-network

networks:
  app-network:
    driver: bridge
  storage-network:
    driver: bridge