diff --git a/.devcontainer/.env b/.devcontainer/.env new file mode 100644 index 00000000..293b0743 --- /dev/null +++ b/.devcontainer/.env @@ -0,0 +1,2 @@ +TRUSTIFY_API_URL=http://backend:8080 +OIDC_SERVER_URL=http://backend:8090/realms/trustify diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile new file mode 100644 index 00000000..88cae803 --- /dev/null +++ b/.devcontainer/Dockerfile @@ -0,0 +1 @@ +FROM mcr.microsoft.com/devcontainers/base:ubuntu diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 00000000..d4fa4087 --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,27 @@ +{ + "name": "trustify-ui", + "dockerComposeFile": "docker-compose.yml", + "service": "frontend", + "workspaceFolder": "/workspaces/${localWorkspaceFolderBasename}", + // Features to add to the dev container. More info: https://containers.dev/features. + "features": { + "ghcr.io/devcontainers/features/docker-in-docker:2": {}, + "ghcr.io/devcontainers/features/node:1": { + "version": "20" + } + }, + // Use 'forwardPorts' to make a list of ports inside the container available locally. + "forwardPorts": [ + 3000 + ], + // Use 'postCreateCommand' to run commands after the container is created. + "postCreateCommand": "bash .devcontainer/postCreateCommand.sh", + // Configure tool-specific properties. + "customizations": { + "jetbrains": { + "backend": "WebStorm" + } + }, + // Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root. + "remoteUser": "root" +} diff --git a/.devcontainer/docker-compose.yml b/.devcontainer/docker-compose.yml new file mode 100644 index 00000000..20839a8d --- /dev/null +++ b/.devcontainer/docker-compose.yml @@ -0,0 +1,15 @@ +networks: + trustification: + +services: + frontend: + build: + context: . + dockerfile: Dockerfile + env_file: + - .env + volumes: + - ../..:/workspaces:cached + command: sleep infinity + networks: + - trustification diff --git a/.devcontainer/postCreateCommand.sh b/.devcontainer/postCreateCommand.sh new file mode 100755 index 00000000..adb8ae58 --- /dev/null +++ b/.devcontainer/postCreateCommand.sh @@ -0,0 +1,7 @@ +apt-get update + +## Git autocomplete +echo "source /usr/share/bash-completion/completions/git" >> ~/.bashrc + +## Install dependencies +npm ci --ignore-scripts