File size: 1,378 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
services:
  frontend:
    image: node:18-alpine
    working_dir: /app
    volumes:
      - ./apps/frontend:/app
    ports:
      - "172.17.0.1:3000:3000" # 172.17.0.1 is the internal docker network for the nginx proxy
    environment:
      - NEXT_PUBLIC_URL=https://myclipboard.online
      - PUBLIC_SOCKET_URL=https://myclipboard.online # in prod should be the same as the public url, because socket will be proxied by nginx
      - DOCKER_BACKEND_URL=http://backend:3001
      - NODE_ENV=production
    command: sh -c "npm i -g pnpm && pnpm install && pnpm build && pnpm start"
    depends_on:
      - backend
    restart: always
    networks:
      - app-network

  backend:
    image: node:18-alpine
    working_dir: /app
    volumes:
      - ./apps/backend:/app
      - ./uploads:/app/uploads # Mount uploads directory for file storage
    ports:
      - "172.17.0.1: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 start"
    restart: always
    networks:
      - app-network
      - storage-network

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