|
| 1 | +## This Docker Compose file is used by the pr-infra-compose.sh script. |
| 2 | +# More explanation on its purpose can be found in the script. |
| 3 | +# |
| 4 | +# This Docker Compose file is very similar to the one used for the development |
| 5 | +# environment, except that no services are built (all images are pulled from DockerHub), |
| 6 | +# and all ports have been adjusted (by adding +1 or +2 if the +1 port was already in use) |
| 7 | +# so that both instances can run concurrently on the same computer. |
| 8 | + |
| 9 | +volumes: |
| 10 | + psql_data: |
| 11 | + redis_data: |
| 12 | + rabbitmq_data: |
| 13 | + |
| 14 | +networks: |
| 15 | + pr-tests: |
| 16 | + name: osrd_pr_test |
| 17 | + |
| 18 | +services: |
| 19 | + postgres: |
| 20 | + image: ${OSRD_POSTGIS_IMAGE:-postgis/postgis:16-3.4-alpine} |
| 21 | + container_name: osrd-postgres-pr-tests |
| 22 | + user: postgres |
| 23 | + restart: unless-stopped |
| 24 | + ports: ["5433:5433"] |
| 25 | + environment: |
| 26 | + POSTGRES_PASSWORD: "password" |
| 27 | + command: -c port=5433 |
| 28 | + volumes: |
| 29 | + - "psql_data:/var/lib/postgresql/data" |
| 30 | + - "../docker/init_db.sql:/docker-entrypoint-initdb.d/init.sql" |
| 31 | + healthcheck: |
| 32 | + test: ["CMD", "pg_isready", "-d", "postgres://osrd:password@postgres:5433/osrd"] |
| 33 | + start_period: 4s |
| 34 | + interval: 5s |
| 35 | + networks: |
| 36 | + - pr-tests |
| 37 | + |
| 38 | + redis: |
| 39 | + image: valkey/valkey:alpine |
| 40 | + container_name: osrd-redis-pr-tests |
| 41 | + restart: unless-stopped |
| 42 | + ports: ["6380:6380"] |
| 43 | + volumes: |
| 44 | + - "redis_data:/data" |
| 45 | + - "../docker/valkey.conf:/etc/valkey.conf" |
| 46 | + command: "valkey-server /etc/valkey.conf --port 6380 --save 30 1 --loglevel warning" |
| 47 | + healthcheck: |
| 48 | + test: ["CMD", "valkey-cli", "-p" , "6380", "ping"] |
| 49 | + start_period: 4s |
| 50 | + interval: 5s |
| 51 | + networks: |
| 52 | + - pr-tests |
| 53 | + |
| 54 | + rabbitmq: |
| 55 | + image: rabbitmq:3-management |
| 56 | + container_name: osrd-rabbitmq-pr-tests |
| 57 | + ports: |
| 58 | + - "5673:5673" |
| 59 | + - "15673:15673" |
| 60 | + environment: |
| 61 | + RABBITMQ_DEFAULT_USER: osrd |
| 62 | + RABBITMQ_DEFAULT_PASS: password |
| 63 | + RABBITMQ_DIST_PORT: 25673 |
| 64 | + RABBITMQ_CONFIG_FILE: "/etc/rabbitmq/rabbitmq.conf" |
| 65 | + volumes: |
| 66 | + - rabbitmq_data:/var/lib/rabbitmq |
| 67 | + - ../docker/rabbitmq-pr-tests.conf:/etc/rabbitmq/rabbitmq.conf |
| 68 | + healthcheck: |
| 69 | + test: ["CMD", "rabbitmqctl", "status"] |
| 70 | + interval: 15s |
| 71 | + timeout: 30s |
| 72 | + retries: 3 |
| 73 | + networks: |
| 74 | + - pr-tests |
| 75 | + |
| 76 | + core: |
| 77 | + image: ghcr.io/openrailassociation/osrd-edge/osrd-core:${PR_NB} |
| 78 | + container_name: osrd-core-dummy-pr-tests |
| 79 | + restart: "no" |
| 80 | + command: "true" |
| 81 | + networks: |
| 82 | + - pr-tests |
| 83 | + |
| 84 | + editoast: |
| 85 | + image: ghcr.io/openrailassociation/osrd-edge/osrd-editoast:${PR_NB} |
| 86 | + container_name: osrd-editoast-pr-tests |
| 87 | + depends_on: |
| 88 | + postgres: {condition: service_healthy} |
| 89 | + redis: {condition: service_healthy} |
| 90 | + rabbitmq: {condition: service_healthy} |
| 91 | + restart: unless-stopped |
| 92 | + ports: ["8091:8091"] |
| 93 | + environment: |
| 94 | + EDITOAST_PORT: 8091 |
| 95 | + ROOT_URL: "http://localhost:8091" |
| 96 | + REDIS_URL: "redis://redis:6380" |
| 97 | + DATABASE_URL: "postgres://osrd:password@postgres:5433/osrd" |
| 98 | + TELEMETRY_KIND: "opentelemetry" |
| 99 | + TELEMETRY_ENDPOINT: "http://jaeger:4319" |
| 100 | + OSRD_MQ_URL: "amqp://osrd:password@osrd-rabbitmq-pr-tests:5673/%2f" |
| 101 | + OSRDYNE_API_URL: "http://osrd-osrdyne-pr-tests:4243/" |
| 102 | + command: |
| 103 | + - /bin/sh |
| 104 | + - -c |
| 105 | + - "diesel migration run && exec editoast runserver" |
| 106 | + healthcheck: |
| 107 | + test: ["CMD", "curl", "-f", "http://localhost:8091/health"] |
| 108 | + start_period: 4s |
| 109 | + interval: 5s |
| 110 | + networks: |
| 111 | + - pr-tests |
| 112 | + |
| 113 | + osrd-images: |
| 114 | + image: ghcr.io/openrailassociation/osrd-stable/osrd-images:${TAG_IMAGES-v1.0.0} |
| 115 | + container_name: osrd-images-pr-tests |
| 116 | + restart: unless-stopped |
| 117 | + environment: |
| 118 | + - NGINX_PORT=8081 |
| 119 | + ports: ["8081:8081"] |
| 120 | + networks: |
| 121 | + - pr-tests |
| 122 | + |
| 123 | + gateway: |
| 124 | + image: ghcr.io/openrailassociation/osrd-edge/osrd-gateway:${PR_NB}-front |
| 125 | + container_name: osrd-gateway-pr-tests |
| 126 | + volumes: |
| 127 | + - "../docker/gateway.pr-tests.simple.toml:/srv/gateway.toml" |
| 128 | + restart: unless-stopped |
| 129 | + ports: ["4001:4001"] |
| 130 | + networks: |
| 131 | + - pr-tests |
| 132 | + |
| 133 | + osrdyne: |
| 134 | + image: ghcr.io/openrailassociation/osrd-edge/osrd-osrdyne:${PR_NB} |
| 135 | + container_name: osrd-osrdyne-pr-tests |
| 136 | + depends_on: |
| 137 | + rabbitmq: {condition: service_healthy} |
| 138 | + volumes: |
| 139 | + - ${DOCKER_SOCKET:-/var/run/docker.sock}:/var/run/docker.sock |
| 140 | + - ../docker/osrdyne-pr-tests.yml:/osrdyne.yml |
| 141 | + command: osrdyne |
| 142 | + restart: unless-stopped |
| 143 | + ports: ["4243:4243"] |
| 144 | + environment: |
| 145 | + OSRDYNE__WORKER_DRIVER__WORKER_IMAGE: "ghcr.io/openrailassociation/osrd-edge/osrd-core:${PR_NB}" |
| 146 | + RUST_LOG: "info" |
| 147 | + networks: |
| 148 | + - pr-tests |
| 149 | + |
| 150 | + jaeger: |
| 151 | + image: jaegertracing/all-in-one:latest |
| 152 | + container_name: osrd-jaeger-pr-tests |
| 153 | + restart: unless-stopped |
| 154 | + command: --collector.otlp.grpc.host-port :4319 --collector.otlp.http.host-port :4320 --query.http-server.host-port :16687 --collector.grpc-server.host-port :14251 |
| 155 | + ports: |
| 156 | + - "4319:4319" |
| 157 | + - "4320:4320" |
| 158 | + - "16687:16687" |
| 159 | + networks: |
| 160 | + - pr-tests |
| 161 | + |
| 162 | + wait-healthy: |
| 163 | + depends_on: |
| 164 | + editoast: {condition: service_healthy} |
| 165 | + restart: "no" |
| 166 | + image: alpine:latest |
| 167 | + command: "true" |
| 168 | + networks: |
| 169 | + - pr-tests |
0 commit comments