-
Notifications
You must be signed in to change notification settings - Fork 24
/
docker-compose.yml
99 lines (97 loc) · 2.88 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
97
98
99
version: '3.4'
services:
proxy:
image: traefik:v2.9
command:
# Enable Docker in Traefik, so that it reads labels from Docker services
- --providers.docker
# Add a constraint to only use services with the label for this stack
# from the env var TRAEFIK_TAG
- --providers.docker.constraints=Label(`traefik.constraint-label-stack`, `${TRAEFIK_TAG?Variable not set}`)
# Do not expose all Docker services, only the ones explicitly exposed
- --providers.docker.exposedbydefault=false
# Enable the access log, with HTTP requests
- --accesslog
# Enable the Traefik log, for configurations and errors
- --log
- --entrypoints.web.address=:80
- --entrypoints.web.forwardedHeaders.insecure=true
restart: on-failure
volumes:
- /var/run/docker.sock:/var/run/docker.sock
ports:
- '8160:80'
worker:
build:
context: backend
args:
AUTO_GPT_VERSION: "${AUTO_GPT_VERSION:-0.4.4}"
command:
- worker
depends_on:
- mysql
restart: on-failure
environment:
- TZ=Etc/UTC
env_file:
- env-backend.env
volumes:
- wb-data:/workspaces
api:
build:
context: backend
args:
AUTO_GPT_VERSION: "${AUTO_GPT_VERSION:-0.4.4}"
command:
- api
depends_on:
- mysql
restart: on-failure
environment:
- TZ=Etc/UTC
env_file:
- env-backend.env
volumes:
- wb-data:/workspaces
labels:
- traefik.enable=true
- traefik.constraint-label-stack=${TRAEFIK_TAG?Variable not set}
- traefik.http.routers.${STACK_NAME?Variable not set}-backend-http.rule=PathPrefix(`${BASE_URL:-}/api`) || PathPrefix(`${BASE_URL:-}/docs`) || PathPrefix(`${BASE_URL:-}/redoc`) || PathPrefix(`${BASE_URL:-}/openapi.json`)
- traefik.http.routers.${STACK_NAME?Variable not set}-backend-http.middlewares=base-stripprefix
- traefik.http.middlewares.base-stripprefix.stripprefix.prefixes=${BASE_URL:-}
- traefik.http.services.${STACK_NAME?Variable not set}-backend.loadbalancer.server.port=80
frontend:
build:
context: frontend
depends_on:
- api
restart: on-failure
environment:
- TZ=Etc/UTC
env_file:
- env-frontend.env
labels:
- traefik.enable=true
- traefik.constraint-label-stack=${TRAEFIK_TAG?Variable not set}
- traefik.http.routers.${STACK_NAME?Variable not set}-frontend-http.rule=PathPrefix(`/`)
- traefik.http.services.${STACK_NAME?Variable not set}-frontend.loadbalancer.server.port=3000
mysql:
image: mysql
restart: unless-stopped
environment:
- TZ=Etc/UTC
env_file:
- env-mysql.env
volumes:
- db-data:/var/lib/mysql
redis:
image: redis
restart: unless-stopped
environment:
- TZ=Etc/UTC
volumes:
- redis-data:/data
volumes:
db-data:
redis-data:
wb-data: