-
Notifications
You must be signed in to change notification settings - Fork 265
/
Copy pathdocker-compose.yml
124 lines (116 loc) · 2.95 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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
version: "3.8"
volumes:
postgres:
driver: local
uploads:
driver: local
typesense:
driver: local
caddy_data:
driver: local
services:
# Databases
postgres:
image: postgres:11
environment:
PGDATA: /var/lib/postgresql/data/pgdata
POSTGRES_USER: kitsu_development
POSTGRES_HOST_AUTH_METHOD: trust
volumes:
- postgres:/var/lib/postgresql/data
ports: [5432]
redis:
image: redis
elasticsearch:
platform: linux/x86_64
image: elasticsearch:2
typesense:
image: typesense/typesense:0.25.1
environment:
TYPESENSE_DATA_DIR: /data
TYPESENSE_API_KEY: xyz
volumes:
- typesense:/data
# Pretend cloud services
mailcatcher:
image: schickling/mailcatcher
minio:
image: minio/minio:latest
command: [server, "--console-address", ":9001", "/data"]
volumes:
- ./uploads:/data
environment:
- MINIO_ROOT_USER=minioadmin
- MINIO_ROOT_PASSWORD=minioadmin
- MINIO_DEFAULT_BUCKETS=kitsu-ugc-dev
- MINIO_BROWSER_REDIRECT_URL=https://admin.media.kitsu.dev:7543/
# Web server, routing /api and / to server, client respectively
router:
build: ./router
command: [caddy, run, --watch, --config, /etc/caddy/Caddyfile]
develop:
watch:
- action: sync
path: ./router/Caddyfile
target: /etc/caddy/Caddyfile
ports:
- target: 80
published: 7580
protocol: tcp
- target: 443
published: 7543
protocol: tcp
- target: 443
published: 7543
protocol: udp
volumes:
- caddy_data:/data
# Application
api: &rails
depends_on: [postgres, redis, elasticsearch, typesense]
build:
context: ./server
dockerfile: Dockerfile.local
develop:
watch:
- action: sync
path: ./server
target: /opt/kitsu/server
- action: sync+restart
path: ./server/config
target: /opt/kitsu/server/config
- action: rebuild
path: ./server/Gemfile.lock
- action: rebuild
path: ./server/Dockerfile.local
environment:
DATABASE_URL: "postgresql://kitsu_development@postgres/"
ELASTICSEARCH_URL: "elasticsearch:9200"
REDIS_URL: "redis://redis/1"
RAILS_ENV: development
SMTP_ADDRESS: "mailcatcher"
SMTP_PORT: "1025"
AWS_ENDPOINT: "http://minio:9000/"
AWS_BUCKET: kitsu-ugc-dev
AWS_ACCESS_KEY_ID: minioadmin
AWS_SECRET_ACCESS_KEY: minioadmin
TYPESENSUAL_API_KEY: xyz
TYPESENSUAL_NODES: http://typesense:8108/
worker:
<<: *rails
command: [sidekiq]
web:
build: ./web
tmpfs:
- /opt/kitsu/client/node_modules/.vite/cache
develop:
watch:
- action: sync
path: ./web
target: /opt/kitsu/web
ignore:
- node_modules/
- action: rebuild
path: package-lock.json
- action: rebuild
path: Dockerfile