-
Notifications
You must be signed in to change notification settings - Fork 45
/
docker-compose.yml
129 lines (122 loc) · 4.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
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
services:
db:
image: docker.io/postgres:9.6
environment:
POSTGRES_USER: cachito
POSTGRES_PASSWORD: cachito
POSTGRES_DB: cachito
POSTGRES_INITDB_ARGS: "--auth='ident' --auth='trust'"
rabbitmq:
image: docker.io/rabbitmq:3.11-management
volumes:
- ./docker/rabbitmq.conf:/etc/rabbitmq/rabbitmq.conf:z
ports:
# The RabbitMQ management console
- 8081:15672
athens:
image: docker.io/gomods/athens:v0.12.1
environment:
ATHENS_DISK_STORAGE_ROOT: /var/lib/athens
ATHENS_STORAGE_TYPE: disk
ATHENS_GO_BINARY_ENV_VARS: GOSUMDB=off
ATHENS_CLOUD_RUNTIME: JSON
volumes:
- athens-storage:/var/lib/athens:z
ports:
- 3000:3000
nexus:
image: docker.io/sonatype/nexus3:3.45.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
-Djava.util.prefs.userRoot=/nexus-data/javaprefs
volumes:
# Use a local volume for nexus data (podman compatibility)
- ./tmp/nexus-data:/nexus-data:z
ports:
- 8082:8081
# Nexus needs more open files, else it will throw errors. The Cachito integration tests expose the problem,
# a java.io.exception of too many open files will be thrown.
ulimits:
nofile:
soft: 65536
hard: 65536
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 -x delete_data=True &&
flask 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
- cachito-archives:/tmp/cachito-archives:z
- cachito-request-logs:/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 \
-- celery -A cachito.workers.tasks worker --loglevel=info
environment:
CACHITO_DEV: 'true'
# This is needed in order to allow volume share with the cachito-api service.
# In an OpenShift environment this is not needed.
privileged: true
volumes:
- ./:/src:z
- 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-data:/nexus-data:z
- cachito-request-logs:/var/log/cachito/requests:z
depends_on:
- cachito-api
- nexus
- rabbitmq
jaeger:
image: docker.io/jaegertracing/all-in-one:latest
ports:
# OTLP/gprc - used by pytest to forward integration test traces to jaeger.
- "4317:4317"
# Development environment is hard-coded to send to port 6831.
- "6831:6831/udp"
# Web UI is available at port 16686
- "16686:16686"
volumes:
cachito-archives:
athens-storage:
cachito-request-logs: