mirror of
https://github.com/invariantlabs-ai/invariant-gateway.git
synced 2026-07-13 13:47:18 +02:00
Update the testing setup.
This commit is contained in:
@@ -0,0 +1,6 @@
|
||||
INVARIANT_API_URL=http://127.0.0.1
|
||||
|
||||
POSTGRES_USER=postgres
|
||||
POSTGRES_PASSWORD=postgres
|
||||
POSTGRES_DB=invariantmonitor
|
||||
POSTGRES_HOST=database
|
||||
@@ -0,0 +1,110 @@
|
||||
name: explorer-proxy-test
|
||||
services:
|
||||
traefik:
|
||||
image: traefik:v2.0
|
||||
container_name: "explorer-proxy-test-traefik"
|
||||
command:
|
||||
- --providers.docker=true
|
||||
# Enable the API handler in insecure mode,
|
||||
# which means that the Traefik API will be available directly
|
||||
# on the entry point named traefik.
|
||||
- --api.insecure=true
|
||||
# Define Traefik entry points to port [80] for http and port [443] for https.
|
||||
- --entrypoints.invariant-explorer-web-test.address=0.0.0.0:80
|
||||
networks:
|
||||
- invariant-explorer-web-test
|
||||
ports:
|
||||
- '${PORT_HTTP:-80}:80'
|
||||
volumes:
|
||||
- /var/run/docker.sock:/var/run/docker.sock
|
||||
labels:
|
||||
- "traefik.enable=true"
|
||||
- "traefik.http.routers.traefik-http.entrypoints=invariant-explorer-web-test"
|
||||
|
||||
explorer-proxy:
|
||||
container_name: explorer-proxy-test
|
||||
build:
|
||||
context: ../proxy
|
||||
dockerfile: ../proxy/Dockerfile.proxy
|
||||
depends_on:
|
||||
app-api:
|
||||
condition: service_healthy
|
||||
working_dir: /srv/proxy
|
||||
env_file:
|
||||
- .env.test
|
||||
environment:
|
||||
- DEV_MODE=true
|
||||
volumes:
|
||||
- type: bind
|
||||
source: ../proxy
|
||||
target: /srv/proxy
|
||||
networks:
|
||||
- invariant-explorer-web-test
|
||||
ports: []
|
||||
labels:
|
||||
- "traefik.enable=true"
|
||||
- "traefik.http.routers.explorer-proxy-api.rule=(Host(`localhost`) && PathPrefix(`/api/v1/proxy/`)) || (Host(`127.0.0.1`) && PathPrefix(`/api/v1/proxy/`))"
|
||||
- "traefik.http.routers.explorer-proxy-api.entrypoints=invariant-explorer-web-test"
|
||||
- "traefik.http.services.explorer-proxy-api.loadbalancer.server.port=8000"
|
||||
- "traefik.docker.network=invariant-explorer-web-test"
|
||||
healthcheck:
|
||||
test: curl -X GET -I http://localhost:8000/api/v1/proxy/health --fail
|
||||
interval: 1s
|
||||
timeout: 5s
|
||||
|
||||
app-api:
|
||||
container_name: explorer-proxy-test-app-api
|
||||
image: ghcr.io/invariantlabs-ai/explorer/app-api:latest
|
||||
platform: linux/amd64
|
||||
depends_on:
|
||||
database:
|
||||
condition: service_healthy
|
||||
working_dir: /srv/app
|
||||
env_file:
|
||||
- .env.test
|
||||
environment:
|
||||
- PROJECTS_DIR=/srv/projects
|
||||
- KEYCLOAK_CLIENT_ID_SECRET=local-does-not-use-keycloak
|
||||
- TZ=Europe/Berlin
|
||||
- DEV_MODE=true
|
||||
- APP_NAME=explorer-test
|
||||
- CONFIG_FILE=/config/explorer.config.yml
|
||||
- PORT_HTTP=8000
|
||||
- PORT_API=80
|
||||
networks:
|
||||
- internal
|
||||
- invariant-explorer-web-test
|
||||
volumes:
|
||||
- /tmp/invariant-proxy-test/configs/explorer.test.yml:/config/explorer.config.yml
|
||||
labels:
|
||||
- "traefik.enable=true"
|
||||
- "traefik.http.routers.explorer-test-api.rule=(Host(`localhost`) && PathPrefix(`/api/`)) || (Host(`127.0.0.1`) && PathPrefix(`/api/`))"
|
||||
- "traefik.http.routers.explorer-test-api.entrypoints=invariant-explorer-web-test"
|
||||
- "traefik.http.services.explorer-test-api.loadbalancer.server.port=8000"
|
||||
- "traefik.docker.network=invariant-explorer-web-test"
|
||||
healthcheck:
|
||||
test: curl -X GET -I http://localhost:8000/api/v1 --fail
|
||||
interval: 1s
|
||||
timeout: 5s
|
||||
|
||||
database:
|
||||
container_name: explorer-proxy-test-database
|
||||
image: postgres:16
|
||||
env_file:
|
||||
- .env.test
|
||||
networks:
|
||||
- internal
|
||||
volumes:
|
||||
- type: bind
|
||||
source: /tmp/invariant-explorer-test/data/database
|
||||
target: /var/lib/postgresql/data
|
||||
healthcheck:
|
||||
test: [ "CMD-SHELL", "pg_isready -U postgres" ]
|
||||
interval: 5s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
|
||||
networks:
|
||||
invariant-explorer-web-test:
|
||||
external: true
|
||||
internal:
|
||||
Reference in New Issue
Block a user