|
| 1 | +## You can generate a custom docker compose file automatically on http://reportportal.io/download (Step 2) |
| 2 | + |
| 3 | +## This is example of Docker Compose for ReportPortal |
| 4 | +## Do not forget to configure data volumes for production usage |
| 5 | + |
| 6 | +## Execute 'docker-compose -f docker-compose.yml -p reportportal up -d --force-recreate' --build |
| 7 | +## to start all containers in daemon mode |
| 8 | +## Where: |
| 9 | +## '-f docker-compose.yml' -- specifies this compose file |
| 10 | +## '-p reportportal' -- specifies container's prefix (project name) |
| 11 | +## '-d' -- enables daemon mode |
| 12 | +## '--force-recreate' -- forces re-recreating of all containers |
| 13 | + |
| 14 | +version: '2.4' |
| 15 | +services: |
| 16 | + |
| 17 | + gateway: |
| 18 | + image: traefik:v2.0.5 |
| 19 | + ports: |
| 20 | + - "8080:8080" # HTTP exposed |
| 21 | + - "8081:8081" # HTTP Administration exposed |
| 22 | + volumes: |
| 23 | + - /var/run/docker.sock:/var/run/docker.sock |
| 24 | + command: |
| 25 | + - --providers.docker=true |
| 26 | + - --providers.docker.constraints=Label(`traefik.expose`, `true`) |
| 27 | + - --entrypoints.web.address=:8080 |
| 28 | + - --entrypoints.traefik.address=:8081 |
| 29 | + - --api.dashboard=true |
| 30 | + - --api.insecure=true |
| 31 | + restart: always |
| 32 | + |
| 33 | + elasticsearch: |
| 34 | + image: docker.elastic.co/elasticsearch/elasticsearch:7.3.0 |
| 35 | + volumes: |
| 36 | + - ./data/elasticsearch:/usr/share/elasticsearch/data |
| 37 | + environment: |
| 38 | + - "bootstrap.memory_lock=true" |
| 39 | + - "discovery.type=single-node" |
| 40 | + - "logger.level=INFO" |
| 41 | + - "xpack.security.enabled=true" |
| 42 | + - "ELASTIC_PASSWORD=elastic1q2w3e" |
| 43 | + ulimits: |
| 44 | + memlock: |
| 45 | + soft: -1 |
| 46 | + hard: -1 |
| 47 | + nofile: |
| 48 | + soft: 65536 |
| 49 | + hard: 65536 |
| 50 | + # ports: |
| 51 | + # - "9200:9200" |
| 52 | + healthcheck: |
| 53 | + test: ["CMD", "curl","-s" ,"-f", "http://elastic:elastic1q2w3e@localhost:9200/_cat/health"] |
| 54 | + restart: always |
| 55 | + |
| 56 | + analyzer: |
| 57 | + image: reportportal/service-auto-analyzer:5.3.4 |
| 58 | + environment: |
| 59 | + LOGGING_LEVEL: info |
| 60 | + AMQP_URL: amqp://rabbitmq:rabbitmq@rabbitmq:5672 |
| 61 | + ES_HOSTS: http://elastic:elastic1q2w3e@elasticsearch:9200 |
| 62 | + MINIO_SHORT_HOST: minio:9000 |
| 63 | + MINIO_ACCESS_KEY: minio |
| 64 | + MINIO_SECRET_KEY: minio123 |
| 65 | + depends_on: |
| 66 | + - elasticsearch |
| 67 | + restart: always |
| 68 | + |
| 69 | + ### Initial reportportal db schema. Run once. |
| 70 | + db-scripts: |
| 71 | + image: reportportal/migrations:5.3.4 |
| 72 | + depends_on: |
| 73 | + postgres: |
| 74 | + condition: service_healthy |
| 75 | + environment: |
| 76 | + POSTGRES_SERVER: postgres |
| 77 | + POSTGRES_PORT: 5432 |
| 78 | + POSTGRES_DB: reportportal |
| 79 | + POSTGRES_USER: rpuser |
| 80 | + POSTGRES_PASSWORD: rppass |
| 81 | + restart: on-failure |
| 82 | + |
| 83 | + postgres: |
| 84 | + image: postgres:12-alpine |
| 85 | + shm_size: '512m' |
| 86 | + environment: |
| 87 | + POSTGRES_USER: rpuser |
| 88 | + POSTGRES_PASSWORD: rppass |
| 89 | + POSTGRES_DB: reportportal |
| 90 | + volumes: |
| 91 | + # For unix host |
| 92 | + - ./data/postgres:/var/lib/postgresql/data |
| 93 | + # For windows host |
| 94 | + # - postgres:/var/lib/postgresql/data |
| 95 | + # If you need to access the DB locally. Could be a security risk to expose DB. |
| 96 | + # ports: |
| 97 | + # - "5432:5432" |
| 98 | + command: |
| 99 | + -c checkpoint_completion_target=0.9 |
| 100 | + -c work_mem=96MB |
| 101 | + -c wal_writer_delay=20ms |
| 102 | + -c synchronous_commit=off |
| 103 | + -c wal_buffers=32MB |
| 104 | + -c min_wal_size=2GB |
| 105 | + -c max_wal_size=4GB |
| 106 | + # Optional, for SSD Data Storage. If you are using the HDD, set up this command to '2' |
| 107 | + # -c effective_io_concurrency=200 |
| 108 | + # Optional, for SSD Data Storage. If you are using the HDD, set up this command to '4' |
| 109 | + # -c random_page_cost=1.1 |
| 110 | + # Optional, can be scaled. Example for 4 CPU, 16GB RAM instance, where only the database is deployed |
| 111 | + # -c max_worker_processes=4 |
| 112 | + # -c max_parallel_workers_per_gather=2 |
| 113 | + # -c max_parallel_workers=4 |
| 114 | + # -c shared_buffers=4GB |
| 115 | + # -c effective_cache_size=12GB |
| 116 | + # -c maintenance_work_mem=1GB |
| 117 | + healthcheck: |
| 118 | + test: ["CMD-SHELL", "pg_isready -d $$POSTGRES_DB -U $$POSTGRES_USER"] |
| 119 | + interval: 10s |
| 120 | + timeout: 120s |
| 121 | + retries: 10 |
| 122 | + restart: always |
| 123 | + |
| 124 | + rabbitmq: |
| 125 | + image: rabbitmq:3.7.16-management |
| 126 | + #ports: |
| 127 | + # - "5672:5672" |
| 128 | + #- "15672:15672" |
| 129 | + environment: |
| 130 | + RABBITMQ_DEFAULT_USER: "rabbitmq" |
| 131 | + RABBITMQ_DEFAULT_PASS: "rabbitmq" |
| 132 | + healthcheck: |
| 133 | + test: ["CMD", "rabbitmqctl", "status"] |
| 134 | + retries: 5 |
| 135 | + restart: always |
| 136 | + |
| 137 | + uat: |
| 138 | + image: reportportal/service-authorization:5.3.3 |
| 139 | + #ports: |
| 140 | + # - "9999:9999" |
| 141 | + environment: |
| 142 | + - RP_DB_HOST=postgres |
| 143 | + - RP_DB_USER=rpuser |
| 144 | + - RP_DB_PASS=rppass |
| 145 | + - RP_DB_NAME=reportportal |
| 146 | + - RP_BINARYSTORE_TYPE=minio |
| 147 | + - RP_BINARYSTORE_MINIO_ENDPOINT=http://minio:9000 |
| 148 | + - RP_BINARYSTORE_MINIO_ACCESSKEY=minio |
| 149 | + - RP_BINARYSTORE_MINIO_SECRETKEY=minio123 |
| 150 | + - RP_SESSION_LIVE=86400 #in seconds |
| 151 | + labels: |
| 152 | + - "traefik.http.middlewares.uat-strip-prefix.stripprefix.prefixes=/uat" |
| 153 | + - "traefik.http.routers.uat.middlewares=uat-strip-prefix@docker" |
| 154 | + - "traefik.http.routers.uat.rule=PathPrefix(`/uat`)" |
| 155 | + - "traefik.http.routers.uat.service=uat" |
| 156 | + - "traefik.http.services.uat.loadbalancer.server.port=9999" |
| 157 | + - "traefik.http.services.uat.loadbalancer.server.scheme=http" |
| 158 | + - "traefik.expose=true" |
| 159 | + restart: always |
| 160 | + |
| 161 | + index: |
| 162 | + image: reportportal/service-index:5.0.10 |
| 163 | + depends_on: |
| 164 | + gateway: |
| 165 | + condition: service_started |
| 166 | + environment: |
| 167 | + - LB_URL=http://gateway:8081 |
| 168 | + - TRAEFIK_V2_MODE=true |
| 169 | + labels: |
| 170 | + - "traefik.http.routers.index.rule=PathPrefix(`/`)" |
| 171 | + - "traefik.http.routers.index.service=index" |
| 172 | + - "traefik.http.services.index.loadbalancer.server.port=8080" |
| 173 | + - "traefik.http.services.index.loadbalancer.server.scheme=http" |
| 174 | + - "traefik.expose=true" |
| 175 | + restart: always |
| 176 | + |
| 177 | + api: |
| 178 | + image: reportportal/service-api:5.3.4 |
| 179 | + depends_on: |
| 180 | + rabbitmq: |
| 181 | + condition: service_healthy |
| 182 | + gateway: |
| 183 | + condition: service_started |
| 184 | + postgres: |
| 185 | + condition: service_healthy |
| 186 | + environment: |
| 187 | + - RP_DB_HOST=postgres |
| 188 | + - RP_DB_USER=rpuser |
| 189 | + - RP_DB_PASS=rppass |
| 190 | + - RP_DB_NAME=reportportal |
| 191 | + - RP_AMQP_USER=rabbitmq |
| 192 | + - RP_AMQP_PASS=rabbitmq |
| 193 | + - RP_AMQP_APIUSER=rabbitmq |
| 194 | + - RP_AMQP_APIPASS=rabbitmq |
| 195 | + - RP_BINARYSTORE_TYPE=minio |
| 196 | + - RP_BINARYSTORE_MINIO_ENDPOINT=http://minio:9000 |
| 197 | + - RP_BINARYSTORE_MINIO_ACCESSKEY=minio |
| 198 | + - RP_BINARYSTORE_MINIO_SECRETKEY=minio123 |
| 199 | + - LOGGING_LEVEL_ORG_HIBERNATE_SQL=info |
| 200 | + - JAVA_OPTS=-Xmx1g -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/tmp -Dcom.sun.management.jmxremote.rmi.port=12349 -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.local.only=false -Dcom.sun.management.jmxremote.port=9010 -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false -Djava.rmi.server.hostname=0.0.0.0 |
| 201 | + labels: |
| 202 | + - "traefik.http.middlewares.api-strip-prefix.stripprefix.prefixes=/api" |
| 203 | + - "traefik.http.routers.api.middlewares=api-strip-prefix@docker" |
| 204 | + - "traefik.http.routers.api.rule=PathPrefix(`/api`)" |
| 205 | + - "traefik.http.routers.api.service=api" |
| 206 | + - "traefik.http.services.api.loadbalancer.server.port=8585" |
| 207 | + - "traefik.http.services.api.loadbalancer.server.scheme=http" |
| 208 | + - "traefik.expose=true" |
| 209 | + restart: always |
| 210 | + |
| 211 | + ui: |
| 212 | + image: reportportal/service-ui:5.3.4 |
| 213 | + environment: |
| 214 | + - RP_SERVER_PORT=8080 |
| 215 | + labels: |
| 216 | + - "traefik.http.middlewares.ui-strip-prefix.stripprefix.prefixes=/ui" |
| 217 | + - "traefik.http.routers.ui.middlewares=ui-strip-prefix@docker" |
| 218 | + - "traefik.http.routers.ui.rule=PathPrefix(`/ui`)" |
| 219 | + - "traefik.http.routers.ui.service=ui" |
| 220 | + - "traefik.http.services.ui.loadbalancer.server.port=8080" |
| 221 | + - "traefik.http.services.ui.loadbalancer.server.scheme=http" |
| 222 | + - "traefik.expose=true" |
| 223 | + restart: always |
| 224 | + |
| 225 | + minio: |
| 226 | + image: minio/minio:RELEASE.2020-10-27T04-03-55Z |
| 227 | + #ports: |
| 228 | + # - '9000:9000' |
| 229 | + volumes: |
| 230 | + # For unix host |
| 231 | + - ./data/storage:/data |
| 232 | + # For windows host |
| 233 | + # - minio:/data |
| 234 | + environment: |
| 235 | + MINIO_ACCESS_KEY: minio |
| 236 | + MINIO_SECRET_KEY: minio123 |
| 237 | + command: server /data |
| 238 | + healthcheck: |
| 239 | + test: ["CMD", "curl", "-f", "http://localhost:9000/minio/health/live"] |
| 240 | + interval: 30s |
| 241 | + timeout: 20s |
| 242 | + retries: 3 |
| 243 | + restart: always |
| 244 | + |
| 245 | + # Docker volume for Windows host |
| 246 | +#volumes: |
| 247 | +# postgres: |
| 248 | +# minio: |
0 commit comments