forked from containerbuildsystem/cachito
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
101 lines (96 loc) · 3.09 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
version: '3'
services:
db:
image: postgres:9.6
environment:
POSTGRES_USER: cachito
POSTGRES_PASSWORD: cachito
POSTGRES_DB: cachito
POSTGRES_INITDB_ARGS: "--auth='ident' --auth='trust'"
rabbitmq:
image: rabbitmq:3.7-management
environment:
RABBITMQ_DEFAULT_USER: cachito
RABBITMQ_DEFAULT_PASS: cachito
ports:
# The RabbitMQ management console
- 8081:15672
athens:
image: gomods/athens:v0.9.0
environment:
ATHENS_DISK_STORAGE_ROOT: /var/lib/athens
ATHENS_STORAGE_TYPE: disk
volumes:
- ./tmp/athens-storage:/var/lib/athens:z
ports:
- 3000:3000
nexus:
image: sonatype/nexus3:3.27.0
environment:
# Enable the script API. This is disabled by default in 3.21.2+.
INSTALL4J_ADD_VM_PARAMS: -Dnexus.scripts.allowCreation=true -Dstorage.diskCache.diskFreeSpaceLimit=512
volumes:
- ./tmp/nexus-volume:/nexus-data:z
ports:
- 8082:8081
cachito-api:
build:
context: .
dockerfile: ./docker/Dockerfile-api
command:
- /bin/sh
- -c
- >-
pip3 uninstall -y cachito &&
python3 setup.py develop --no-deps &&
cachito wait-for-db &&
cachito db upgrade &&
flask-3 run --reload --host 0.0.0.0 --port 8080
environment:
FLASK_ENV: development
FLASK_APP: cachito/web/wsgi.py
CACHITO_DEV: 'true'
volumes:
- ./:/src:z
- ./tmp/cachito-archives:/tmp/cachito-archives:z
- ./tmp/request-logs-volume:/var/log/cachito/requests:z
# This is needed in order to allow cleaning up a temporary tarball
# which is populated by the worker container. In an OpenShift environment
# this is not needed.
privileged: true
depends_on:
- db
ports:
- 8080:8080
cachito-worker:
build:
context: .
dockerfile: ./docker/Dockerfile-workers
# Override the default command so that Celery auto-reloads on code changes
# Instead of using cachito-update-nexus-scripts directly, we must perform this workaround
# because the console scripts are not available in this container. This is because the
# API container performs the `setup.py develop` and not this container and the source is
# shared.
command:
- /bin/bash
- -c
- >-
pip3 install watchdog[watchmedo] &&
/src/docker/configure-nexus.py &&
python3 -c 'from cachito.workers.nexus import create_or_update_scripts; create_or_update_scripts()' &&
watchmedo auto-restart -d ./cachito/workers -p '*.py' --recursive \
-- /bin/celery-3 -A cachito.workers.tasks worker --loglevel=info
environment:
CACHITO_DEV: 'true'
volumes:
- ./:/src:z
- ./tmp/cachito-archives:/tmp/cachito-archives:z
# This is mounted in this container so that this container can view the admin.password file
# generated by Nexus and delete it once the configure-nexus.py script changes the admin
# password
- ./tmp/nexus-volume:/nexus-data:z
- ./tmp/request-logs-volume:/var/log/cachito/requests:z
depends_on:
- cachito-api
- nexus
- rabbitmq