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.9-management volumes: - ./docker/rabbitmq.conf:/etc/rabbitmq/rabbitmq.conf:z ports: # The RabbitMQ management console - 8081:15672 athens: image: gomods/athens:v0.11.0 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: 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 volumes: cachito-archives: athens-storage: cachito-request-logs: