-
Notifications
You must be signed in to change notification settings - Fork 27
/
docker-compose.yml
147 lines (131 loc) · 4.11 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
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
version: "3.8"
x-django-service: &django-service
build:
context: .
dockerfile: ./Dockerfile
args:
BUILD_INSTALL_EXTRAS: ${BUILD_INSTALL_EXTRAS}
environment:
CELERY_BROKER_URL: "pyamqp://django:django@rabbitmq/django"
CELERY_QUEUES: "celery,background.cache,background.task,background.long_running,log.downloads"
DATABASE_URL: "psql://django:django@dbpool/django"
REDIS_URL: "redis://redis:6379/0"
REDIS_URL_LEGACY: "redis://redis:6379/1"
REDIS_URL_PROFILES: "redis://redis:6379/2"
REDIS_URL_DOWNLOADS: "redis://redis:6379/3"
PROTOCOL: "http://"
AWS_ACCESS_KEY_ID: "thunderstore"
AWS_SECRET_ACCESS_KEY: "thunderstore"
AWS_S3_REGION_NAME: ""
AWS_S3_ENDPOINT_URL: "http://minio:9000/"
AWS_S3_CUSTOM_DOMAIN: "localhost:9000/thunderstore"
AWS_STORAGE_BUCKET_NAME: "thunderstore"
AWS_LOCATION: "development"
AWS_S3_SECURE_URLS: "False"
USERMEDIA_S3_ENDPOINT_URL: "http://minio:9000/"
USERMEDIA_S3_SIGNING_ENDPOINT_URL: "http://thunderstore.localhost:9000/"
USERMEDIA_S3_ACCESS_KEY_ID: "thunderstore"
USERMEDIA_S3_SECRET_ACCESS_KEY: "thunderstore"
USERMEDIA_S3_REGION_NAME: ""
USERMEDIA_S3_STORAGE_BUCKET_NAME: "thunderstore"
USERMEDIA_S3_LOCATION: "development"
CACHE_S3_ENDPOINT_URL: "http://minio:9000/"
CACHE_S3_ACCESS_KEY_ID: "thunderstore"
CACHE_S3_SECRET_ACCESS_KEY: "thunderstore"
CACHE_S3_REGION_NAME: ""
CACHE_S3_STORAGE_BUCKET_NAME: "thunderstore"
CACHE_S3_LOCATION: "development/cache"
CACHE_S3_FILE_OVERWRITE: "True"
CACHE_S3_CUSTOM_DOMAIN: "localhost:9000/thunderstore"
CACHE_S3_SECURE_URLS: "False"
CACHE_S3_DEFAULT_ACL: "private"
SOURCE_VIEW_ENABLE_HIGHLIGHTING: "True"
USE_ASYNC_PACKAGE_SUBMISSION_FLOW: "True"
USE_TIME_SERIES_PACKAGE_DOWNLOAD_METRICS: "True"
env_file:
- .env
depends_on:
- db
- redis
- rabbitmq
x-django-volumes: &django-volumes
volumes:
- django-data:/app/var:ro
- ./django:/app:ro
- ./python-packages:/python-packages:ro
- built-static:/app/static_built:ro
services:
db:
image: postgres:13.12-alpine
environment:
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
POSTGRES_USER: ${POSTGRES_USER}
POSTGRES_DB: ${POSTGRES_DB}
volumes:
- db-data:/var/lib/postgresql/data
- "./db-mount:/db-mount"
dbpool:
image: edoburu/pgbouncer:1.15.0@sha256:2f47bf272fa9fdf25c100d11f1972b23af61a351a136d3721bfa6bdb52630426
environment:
DATABASE_URL: "postgres://django:django@db/django"
POOL_MODE: "transaction"
volumes:
- ./pgbouncer.ini:/etc/pgbouncer/pgbouncer.ini:ro
logging:
driver: none
redis:
image: redis:7.0-rc2-alpine3.15
command: --maxmemory 200mb --maxmemory-policy allkeys-lru --maxmemory-clients 10%
rabbitmq:
image: rabbitmq:3.8.14-alpine@sha256:11d8cd02ac340e99de628053f76bb1182ce3df3b41d3e8f399377276ba489409
hostname: rabbitmq
environment:
RABBITMQ_DEFAULT_USER: django
RABBITMQ_DEFAULT_PASS: django
RABBITMQ_DEFAULT_VHOST: django
logging:
driver: none
minio:
build:
context: .
dockerfile: minio/Dockerfile
ports:
- "127.0.0.1:9000:9000"
volumes:
- minio-data:/data
environment:
MINIO_ROOT_USER: thunderstore
MINIO_ROOT_PASSWORD: thunderstore
command: server /data
django:
<<: *django-service
command: gunicorn
volumes:
- django-data:/app/var
- ./django:/app
- ./python-packages:/python-packages
- built-static:/app/static_built:ro
ports:
- "127.0.0.1:80:8000"
depends_on:
- builder
django-worker:
<<: [*django-service, *django-volumes]
command: celeryworker
django-beat:
<<: [*django-service, *django-volumes]
command: celerybeat
builder:
build:
context: .
dockerfile: ./docker/builder.Dockerfile
volumes:
- built-static:/home/node/app/build
- ./builder/src:/home/node/app/src:ro
- ./builder/worker_src:/home/node/app/worker_src:ro
- ./builder/gulpfile.js:/home/node/app/gulpfile.js:ro
volumes:
db-data:
django-data:
minio-data:
built-static: