diff --git a/apps/web/docker-compose.yml b/apps/web/docker-compose.yml new file mode 100644 index 000000000000..11ec2f126584 --- /dev/null +++ b/apps/web/docker-compose.yml @@ -0,0 +1,66 @@ +version: '3' +services: + elasticsearch: + image: docker.io/elasticsearch:8.8.0 + ports: + - 9200:9200 + - 9300:9300 + environment: + - discovery.type=single-node + - xpack.security.enabled=false + healthcheck: + test: ['CMD-SHELL', 'curl -f http://localhost:9200 || exit 1'] + interval: 10s + retries: 10 + + init-elasticsearch: + image: docker.io/curlimages/curl:7.85.0 + depends_on: + elasticsearch: + condition: service_healthy + entrypoint: > + sh -c " + until curl -s http://elasticsearch:9200; do + echo 'Waiting for Elasticsearch...'; + sleep 5; + done; + curl -X PUT 'http://elasticsearch:9200/island-is-kstnl' -H 'Content-Type: application/json' -d' + { + \"settings\": { + \"number_of_shards\": 1, + \"number_of_replicas\": 1 + }, + \"mappings\": { + \"properties\": { + \"title\": { + \"type\": \"text\", + \"fields\": { + \"sort\": { + \"type\": \"keyword\" + } + } + }, + \"dateUpdated\": { + \"type\": \"date\" + }, + \"dateCreated\": { + \"type\": \"date\" + }, + \"releaseDate\": { + \"type\": \"date\" + }, + \"tags\": { + \"type\": \"nested\", + \"properties\": { + \"key\": { + \"type\": \"keyword\" + }, + \"type\": { + \"type\": \"keyword\" + } + } + } + } + } + }'; + " diff --git a/apps/web/playwright.config.ts b/apps/web/playwright.config.ts index ed79a07fe22b..5bd18ea39c09 100644 --- a/apps/web/playwright.config.ts +++ b/apps/web/playwright.config.ts @@ -2,8 +2,8 @@ import { createPlaywrightConfig } from '@island.is/testing/e2e' const playwrightConfig = createPlaywrightConfig({ webServerUrl: 'http://localhost:4200', - command: - 'yarn infra run-local-env web --dependencies api --print --no-secrets --proxies', + app: 'web', + dependencies: ['api'], }) export default playwrightConfig diff --git a/apps/web/project.json b/apps/web/project.json index 9c2c9ffc8282..5c8fda302961 100644 --- a/apps/web/project.json +++ b/apps/web/project.json @@ -125,6 +125,14 @@ "parallel": false } }, + "dev-services": { + "executor": "nx:run-commands", + "options": { + "command": "docker compose up -d", + "cwd": "apps/web" + }, + "configurations": {} + }, "dev": { "executor": "nx:run-commands", "options": {