From 733b1bd1af190f51f8b92d1183209cef06dec17d Mon Sep 17 00:00:00 2001 From: Marek Lesko Date: Thu, 10 Jul 2025 07:29:50 +0000 Subject: [PATCH] UPDATED devcontainer configuration to enable VS CODE WEB development --- .devcontainer/Dockerfile | 2 +- .devcontainer/docker-compose.yml | 3 ++- .gitpod/automations.yaml | 37 ++++++++++++++++++++++++++++++++ Web/angular.json | 11 +++++++++- Web/package.json | 2 +- index.html | 15 +++++++++++++ 6 files changed, 66 insertions(+), 4 deletions(-) create mode 100644 .gitpod/automations.yaml create mode 100644 index.html diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index 9d6247c..8df312e 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -8,7 +8,7 @@ RUN bash ./installSQLtools.sh \ # [Optional] Uncomment this section to install additional OS packages. # RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \ # && apt-get -y install --no-install-recommends - +EXPOSE 4200 # [Optional] Uncomment this line to install global node packages. RUN su vscode -c "source /usr/local/share/nvm/nvm.sh && nvm install --lts && nvm use --lts && npm install -g typescript" 2>&1 # RUN su vscode -c "source /usr/local/share/nvm/nvm.sh && npm install -g " 2>&1 diff --git a/.devcontainer/docker-compose.yml b/.devcontainer/docker-compose.yml index 1bcdd26..a51bfc2 100644 --- a/.devcontainer/docker-compose.yml +++ b/.devcontainer/docker-compose.yml @@ -11,7 +11,8 @@ services: # Overrides default command so things don't shut down after the process ends. command: sleep infinity - + ports: + - "4200:4200" # Runs app on the same network as the database container, allows "forwardPorts" in devcontainer.json function. network_mode: host diff --git a/.gitpod/automations.yaml b/.gitpod/automations.yaml new file mode 100644 index 0000000..79f2b34 --- /dev/null +++ b/.gitpod/automations.yaml @@ -0,0 +1,37 @@ +tasks: + hello: + name: Hello World + command: | + echo "Hello, World!" + triggeredBy: + - manual + # - postEnvironmentStart + # - postDevcontainerStart + +services: + example-service: + name: Example Service + description: Example service simulating a backend + commands: + start: | + echo "Starting backend service..." + touch /tmp/backend.started + while true; do + sleep 1 + date + done + ready: | + if [ -f /tmp/backend.started ]; then + echo "Backend service is ready" + exit 0 + else + echo "Backend service is not ready" + exit 1 + fi + # stop: | + # echo "Stopping backend service..." + # rm /tmp/backend.started + # pkill backend + triggeredBy: + - postEnvironmentStart + # - postDevcontainerStart diff --git a/Web/angular.json b/Web/angular.json index bba6db0..d76209f 100644 --- a/Web/angular.json +++ b/Web/angular.json @@ -56,6 +56,12 @@ }, "serve": { "builder": "@angular/build:dev-server", + "options": { + "allowedHosts": [ + "localhost", + "4200--0197f0a3-fef1-7776-b920-71d5d9c3d787.us01.gitpod.dev" + ] + }, "configurations": { "production": { "buildTarget": "Web:build:production" @@ -87,5 +93,8 @@ } } } + }, + "cli": { + "analytics": false } -} +} \ No newline at end of file diff --git a/Web/package.json b/Web/package.json index bc79c3f..9d529a0 100644 --- a/Web/package.json +++ b/Web/package.json @@ -3,7 +3,7 @@ "version": "0.0.0", "scripts": { "ng": "ng", - "start": "ng serve", + "start": "ng serve --host 0.0.0.0", "build": "ng build", "watch": "ng build --watch --configuration development", "test": "ng test" diff --git a/index.html b/index.html new file mode 100644 index 0000000..8ddf9fc --- /dev/null +++ b/index.html @@ -0,0 +1,15 @@ + + + + + + + Web + + + + + + + +