|
| 1 | +x-environment: |
| 2 | + &common-env |
| 3 | + - EDA_DB_HOST=postgres |
| 4 | + - EDA_MQ_HOST=redis |
| 5 | + - DJANGO_SETTINGS_MODULE=${DJANGO_SETTINGS_MODULE:-aap_eda.settings.development} |
| 6 | + - EDA_ALLOWED_HOSTS=['*'] |
| 7 | + - EDA_DEPLOYMENT_TYPE=${EDA_DEPLOYMENT_TYPE:-podman} |
| 8 | + - EDA_WEBSOCKET_BASE_URL=${EDA_WEBSOCKET_BASE_URL:-ws://eda-ws:8000} |
| 9 | + - EDA_WEBSOCKET_SSL_VERIFY=no |
| 10 | + - EDA_PODMAN_SOCKET_URL=tcp://podman:8888 |
| 11 | + - EDA_CONTROLLER_URL=${EDA_CONTROLLER_URL:-https://awx-example.com} |
| 12 | + - EDA_CONTROLLER_TOKEN=${EDA_CONTROLLER_TOKEN:-some-secret-token} |
| 13 | + - EDA_CONTROLLER_SSL_VERIFY=${EDA_CONTROLLER_SSL_VERIFY:-no} |
| 14 | + - EDA_PROTOCOL=http |
| 15 | + - EDA_HOST=${EDA_HOST:-eda-api:8000} |
| 16 | + - EDA_SERVER=http://${EDA_HOST:-eda-api:8000} |
| 17 | + - EDA_ANSIBLE_RULEBOOK_LOG_LEVEL=${EDA_ANSIBLE_RULEBOOK_LOG_LEVEL:-'-v'} |
| 18 | + - EDA_CONTAINER_NAME_PREFIX=${EDA_CONTAINER_NAME_PREFIX:-eda} |
| 19 | + - EDA_PODMAN_ENV_VARS=${EDA_PODMAN_ENV_VARS:-'@none None'} |
| 20 | + - EDA_MAX_RUNNING_ACTIVATIONS=${EDA_MAX_RUNNING_ACTIVATIONS:-5} |
| 21 | + - EDA_ACTIVATION_RESTART_SECONDS_ON_COMPLETE=${EDA_ACTIVATION_RESTART_SECONDS_ON_COMPLETE:-60} |
| 22 | + - EDA_ACTIVATION_RESTART_SECONDS_ON_FAILURE=${EDA_ACTIVATION_RESTART_SECONDS_ON_FAILURE:-60} |
| 23 | + |
| 24 | +services: |
| 25 | + podman-pre-setup: |
| 26 | + user: "0" |
| 27 | + image: quay.io/containers/podman:${EDA_PODMAN_VERSION:-v4} |
| 28 | + privileged: true |
| 29 | + command: >- |
| 30 | + chown -R podman /home/podman/.local/share/containers/storage |
| 31 | + volumes: |
| 32 | + - 'podman_data:/home/podman/.local/share/containers/storage' |
| 33 | + |
| 34 | + podman: |
| 35 | + user: "1000" |
| 36 | + image: quay.io/containers/podman:${EDA_PODMAN_VERSION:-v4} |
| 37 | + privileged: true |
| 38 | + command: >- |
| 39 | + podman system service --time=0 tcp://0.0.0.0:8888 |
| 40 | + ports: |
| 41 | + - "${EDA_PODMAN_PORT:-8888}:8888" |
| 42 | + volumes: |
| 43 | + - 'podman_data:/home/podman/.local/share/containers/storage' |
| 44 | + depends_on: |
| 45 | + - podman-pre-setup |
| 46 | + |
| 47 | + eda-ui: |
| 48 | + image: "${EDA_UI_IMAGE:-quay.io/ansible/eda-ui:main}" |
| 49 | + environment: *common-env |
| 50 | + ports: |
| 51 | + - '${EDA_UI_PORT:-8443}:443' |
| 52 | + depends_on: |
| 53 | + eda-api: |
| 54 | + condition: service_healthy |
| 55 | + |
| 56 | + eda-api: |
| 57 | + image: "${EDA_IMAGE:-localhost/aap-eda}" |
| 58 | + build: |
| 59 | + context: ../../ |
| 60 | + dockerfile: tools/docker/Dockerfile |
| 61 | + environment: *common-env |
| 62 | + security_opt: |
| 63 | + - label=disable |
| 64 | + command: |
| 65 | + - /bin/bash |
| 66 | + - -c |
| 67 | + - >- |
| 68 | + aap-eda-manage migrate |
| 69 | + && aap-eda-manage create_initial_data |
| 70 | + && scripts/create_superuser.sh |
| 71 | + && aap-eda-manage runserver 0.0.0.0:8000 |
| 72 | + ports: |
| 73 | + - "${EDA_API_PORT:-8000}:8000" |
| 74 | + depends_on: |
| 75 | + redis: |
| 76 | + condition: service_healthy |
| 77 | + postgres: |
| 78 | + condition: service_healthy |
| 79 | + healthcheck: |
| 80 | + test: [ 'CMD', 'curl', '-q', 'http://localhost:8000/_healthz' ] |
| 81 | + interval: 30s |
| 82 | + timeout: 5s |
| 83 | + retries: 10 |
| 84 | + volumes: |
| 85 | + - ${EDA_HOST_PODMAN_SOCKET_URL:-/run/user/501/podman/podman.sock}:/run/podman/podman.sock:z |
| 86 | + |
| 87 | + eda-ws: |
| 88 | + image: "${EDA_IMAGE:-localhost/aap-eda}" |
| 89 | + environment: *common-env |
| 90 | + command: |
| 91 | + - /bin/bash |
| 92 | + - -c |
| 93 | + - >- |
| 94 | + aap-eda-manage runserver 0.0.0.0:8000 |
| 95 | + ports: |
| 96 | + - "${EDA_WS_PORT:-8001}:8000" |
| 97 | + depends_on: |
| 98 | + eda-api: |
| 99 | + condition: service_healthy |
| 100 | + |
| 101 | + eda-scheduler: |
| 102 | + image: "${EDA_IMAGE:-localhost/aap-eda}" |
| 103 | + environment: *common-env |
| 104 | + command: |
| 105 | + - /bin/bash |
| 106 | + - -c |
| 107 | + - >- |
| 108 | + aap-eda-manage scheduler |
| 109 | + depends_on: |
| 110 | + redis: |
| 111 | + condition: service_healthy |
| 112 | + postgres: |
| 113 | + condition: service_healthy |
| 114 | + |
| 115 | + eda-default-worker: |
| 116 | + user: "${EDA_POD_USER_ID:-0}" |
| 117 | + deploy: |
| 118 | + replicas: ${EDA_DEFAULT_WORKERS:-1} |
| 119 | + image: "${EDA_IMAGE:-localhost/aap-eda}" |
| 120 | + environment: *common-env |
| 121 | + security_opt: |
| 122 | + - label=disable |
| 123 | + command: |
| 124 | + - aap-eda-manage |
| 125 | + - rqworker |
| 126 | + - --worker-class |
| 127 | + - aap_eda.core.tasking.DefaultWorker |
| 128 | + depends_on: |
| 129 | + eda-api: |
| 130 | + condition: service_healthy |
| 131 | + redis: |
| 132 | + condition: service_healthy |
| 133 | + postgres: |
| 134 | + condition: service_healthy |
| 135 | + volumes: |
| 136 | + - ${EDA_HOST_PODMAN_SOCKET_URL:-/run/user/501/podman/podman.sock}:/run/podman/podman.sock:z |
| 137 | + restart: always |
| 138 | + |
| 139 | + eda-activation-worker: |
| 140 | + user: "${EDA_POD_USER_ID:-0}" |
| 141 | + deploy: |
| 142 | + replicas: ${EDA_ACTIVATION_WORKERS:-2} |
| 143 | + image: "${EDA_IMAGE:-localhost/aap-eda}" |
| 144 | + security_opt: |
| 145 | + - label=disable |
| 146 | + command: |
| 147 | + - aap-eda-manage |
| 148 | + - rqworker |
| 149 | + - --worker-class |
| 150 | + - aap_eda.core.tasking.ActivationWorker |
| 151 | + environment: *common-env |
| 152 | + depends_on: |
| 153 | + eda-api: |
| 154 | + condition: service_healthy |
| 155 | + redis: |
| 156 | + condition: service_healthy |
| 157 | + postgres: |
| 158 | + condition: service_healthy |
| 159 | + volumes: |
| 160 | + - ${EDA_HOST_PODMAN_SOCKET_URL:-/run/user/501/podman/podman.sock}:/run/podman/podman.sock:z |
| 161 | + restart: always |
| 162 | + |
| 163 | + postgres: |
| 164 | + image: 'quay.io/sclorg/postgresql-13-c9s:latest' |
| 165 | + environment: |
| 166 | + POSTGRESQL_USER: eda |
| 167 | + POSTGRESQL_PASSWORD: secret |
| 168 | + POSTGRESQL_ADMIN_PASSWORD: secret |
| 169 | + POSTGRESQL_DATABASE: eda |
| 170 | + ports: |
| 171 | + - '${EDA_PG_PORT:-5432}:5432' |
| 172 | + volumes: |
| 173 | + - 'postgres_data:/var/lib/pgsql/data' |
| 174 | + healthcheck: |
| 175 | + test: [ 'CMD', 'pg_isready', '-U', 'postgres' ] |
| 176 | + interval: 5s |
| 177 | + timeout: 5s |
| 178 | + retries: 3 |
| 179 | + start_period: 5s |
| 180 | + |
| 181 | + redis: |
| 182 | + image: 'quay.io/sclorg/redis-6-c9s:latest' |
| 183 | + ports: |
| 184 | + - '${EDA_REDIS_PORT:-6379}:6379' |
| 185 | + healthcheck: |
| 186 | + test: [ 'CMD', 'redis-cli', 'ping' ] |
| 187 | + interval: 5s |
| 188 | + timeout: 5s |
| 189 | + retries: 3 |
| 190 | + start_period: 5s |
| 191 | + |
| 192 | +volumes: |
| 193 | + postgres_data: {} |
| 194 | + podman_data: {} |
0 commit comments