-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
96 lines (92 loc) · 2.98 KB
/
docker-compose.yml
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
version: "3"
services:
traefik:
restart: always
image: traefik
container_name: traefik
command:
- "--api.insecure=true"
- "--providers.docker=true"
- "--providers.docker.exposedbydefault=false"
- "--entrypoints.web.address=:80"
- "--entrypoints.websecure.address=:443"
- "--certificatesresolvers.letsencrypt.acme.tlschallenge=true"
- "--certificatesresolvers.letsencrypt.acme.email=hibobo@kurama-chat.xyz"
- "--certificatesresolvers.letsencrypt.acme.storage=/acme/acme.json"
ports:
- "80:80"
- "443:443"
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- ./volumes/traefik/acme:/acme
- ./volumes/traefik/logs:/logs
networks:
- web
mongodb:
restart: always
image: mongo:4.2.19
container_name: mongodb
environment:
- MONGO_INITDB_ROOT_USERNAME=${MONGO_INITDB_ROOT_USERNAME}
- MONGO_INITDB_ROOT_PASSWORD=${MONGO_INITDB_ROOT_PASSWORD}
- MONGO_INITDB_DATABASE=${MONGO_INITDB_DATABASE}
- MONGODB_USER=${MONGODB_USER}
- MONGODB_USER_PASSWORD=${MONGODB_USER_PASSWORD}
volumes:
- ./init-mongo.sh:/docker-entrypoint-initdb.d/init-mongo.sh
networks:
- web
backend:
restart: always
container_name: backend
image: node:21
working_dir: /backend
command: sh -c "npm install && npm rebuild bcrypt --build-from-source && npx nodemon"
volumes:
- ./backend:/backend
- ./volumes/traefik/acme:/acme
networks:
- web
environment:
- MONGO_INITDB_ROOT_USERNAME=${MONGO_INITDB_ROOT_USERNAME}
- MONGO_INITDB_ROOT_PASSWORD=${MONGO_INITDB_ROOT_PASSWORD}
- MONGO_INITDB_DATABASE=${MONGO_INITDB_DATABASE}
- MONGODB_USER=${MONGODB_USER}
- MONGODB_USER_PASSWORD=${MONGODB_USER_PASSWORD}
- ORIGIN_URL=${ORIGIN_URL}
- PORT=${PORT}
- DEBUG=${DEBUG}
ports:
- 4000:4000
frontend:
restart: always
container_name: frontend
depends_on:
- traefik
image: node:21
working_dir: /frontend/src
command: sh -c 'npm install --legacy-peer-deps && npm run dev'
volumes:
- ./frontend:/frontend/src
labels:
- "traefik.enable=true"
- traefik.http.routers.frontend.rule=Host(`kurama-chat.xyz`)
- traefik.http.routers.frontend.entrypoints=websecure
- traefik.http.routers.frontend.tls.certresolver=letsencrypt
- traefik.http.routers.frontend.tls=true
- traefik.http.routers.frontend.tls.domains[0].main=kurama-chat.xyz
- traefik.http.services.frontend.loadbalancer.server.port=3000
networks:
- web
environment:
- MONGO_INITDB_ROOT_USERNAME=${MONGO_INITDB_ROOT_USERNAME}
- MONGO_INITDB_ROOT_PASSWORD=${MONGO_INITDB_ROOT_PASSWORD}
- MONGO_INITDB_DATABASE=${MONGO_INITDB_DATABASE}
- MONGODB_USER=${MONGODB_USER}
- MONGODB_USER_PASSWORD=${MONGODB_USER_PASSWORD}
- BROWSER=none
- NEXT_PUBLIC_BASE_URL=${NEXT_PUBLIC_BASE_URL}
ports:
- 3000:3000
networks:
web: