forked from Agenta-AI/agenta
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.prod.yml
113 lines (106 loc) · 2.86 KB
/
docker-compose.prod.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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
services:
reverse-proxy:
image: traefik:v2.10
command: --api.insecure=true --providers.docker --entrypoints.web.address=:80
ports:
- "80:80"
- "8080:8080"
volumes:
- /var/run/docker.sock:/var/run/docker.sock
networks:
- agenta-network
backend:
build: ./agenta-backend
environment:
- MONGODB_URI=mongodb://username:password@mongo:27017
- ALLOW_ORIGINS=${ALLOW_ORIGINS}
- ENVIRONMENT=production
- FEATURE_FLAG=oss
volumes:
- ./agenta-backend/agenta_backend:/app/agenta_backend
- ./agenta-backend/tests:/app/tests
- /var/run/docker.sock:/var/run/docker.sock
- ./agenta-backend/db:/db
labels:
- "traefik.http.routers.backend.rule=Host(`${BARE_DOMAIN_NAME}`) && PathPrefix(`/api/`)"
- "traefik.http.routers.backend.entrypoints=web"
- "traefik.http.middlewares.backend-strip.stripprefix.prefixes=/api"
- "traefik.http.middlewares.backend-strip.stripprefix.forceslash=true"
- "traefik.http.routers.backend.middlewares=backend-strip"
- "traefik.http.services.backend.loadbalancer.server.port=8000"
- "traefik.http.routers.backend.service=backend"
networks:
- agenta-network
command:
[
"uvicorn",
"agenta_backend.main:app",
"--host",
"0.0.0.0",
"--port",
"8000",
"--reload",
"--root-path",
"/api"
]
env_file:
- .env
depends_on:
mongo:
condition: service_healthy
agenta-web:
build:
context: ./agenta-web
dockerfile: prod.Dockerfile
volumes:
- ./agenta-web/src:/app/src
- ./agenta-web/public:/app/public
ports:
- "3000:3000"
networks:
- agenta-network
labels:
- "traefik.http.routers.agenta-web.rule=Host(`${BARE_DOMAIN_NAME}`) && PathPrefix(`/`)"
- "traefik.http.routers.agenta-web.entrypoints=web"
- "traefik.http.services.agenta-web.loadbalancer.server.port=3000"
mongo:
image: mongo:5.0
environment:
MONGO_INITDB_ROOT_USERNAME: username
MONGO_INITDB_ROOT_PASSWORD: password
volumes:
- mongodb_data:/data/db
ports:
- "27017:27017"
networks:
- agenta-network
healthcheck:
test: [ "CMD", "mongo", "--eval", "db.adminCommand('ping')" ]
interval: 10s
timeout: 10s
retries: 20
mongo_express:
image: mongo-express
environment:
ME_CONFIG_MONGODB_ADMINUSERNAME: username
ME_CONFIG_MONGODB_ADMINPASSWORD: password
ME_CONFIG_MONGODB_SERVER: mongo
ports:
- "8081:8081"
networks:
- agenta-network
depends_on:
mongo:
condition: service_healthy
redis:
image: redis:latest
networks:
- agenta-network
volumes:
- redis_data:/data
networks:
agenta-network:
name: agenta-network
volumes:
mongodb_data:
redis_data: