UPDATED devcontainer configuration to enable VS CODE WEB development

This commit is contained in:
Marek Lesko
2025-07-10 07:29:50 +00:00
parent a8848a3e5e
commit 733b1bd1af
6 changed files with 66 additions and 4 deletions

View File

@@ -8,7 +8,7 @@ RUN bash ./installSQLtools.sh \
# [Optional] Uncomment this section to install additional OS packages. # [Optional] Uncomment this section to install additional OS packages.
# RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \ # RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
# && apt-get -y install --no-install-recommends <your-package-list-here> # && apt-get -y install --no-install-recommends <your-package-list-here>
EXPOSE 4200
# [Optional] Uncomment this line to install global node packages. # [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 && 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 <your-package-here>" 2>&1 # RUN su vscode -c "source /usr/local/share/nvm/nvm.sh && npm install -g <your-package-here>" 2>&1

View File

@@ -11,7 +11,8 @@ services:
# Overrides default command so things don't shut down after the process ends. # Overrides default command so things don't shut down after the process ends.
command: sleep infinity command: sleep infinity
ports:
- "4200:4200"
# Runs app on the same network as the database container, allows "forwardPorts" in devcontainer.json function. # Runs app on the same network as the database container, allows "forwardPorts" in devcontainer.json function.
network_mode: host network_mode: host

37
.gitpod/automations.yaml Normal file
View File

@@ -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

View File

@@ -56,6 +56,12 @@
}, },
"serve": { "serve": {
"builder": "@angular/build:dev-server", "builder": "@angular/build:dev-server",
"options": {
"allowedHosts": [
"localhost",
"4200--0197f0a3-fef1-7776-b920-71d5d9c3d787.us01.gitpod.dev"
]
},
"configurations": { "configurations": {
"production": { "production": {
"buildTarget": "Web:build:production" "buildTarget": "Web:build:production"
@@ -87,5 +93,8 @@
} }
} }
} }
},
"cli": {
"analytics": false
} }
} }

View File

@@ -3,7 +3,7 @@
"version": "0.0.0", "version": "0.0.0",
"scripts": { "scripts": {
"ng": "ng", "ng": "ng",
"start": "ng serve", "start": "ng serve --host 0.0.0.0",
"build": "ng build", "build": "ng build",
"watch": "ng build --watch --configuration development", "watch": "ng build --watch --configuration development",
"test": "ng test" "test": "ng test"

15
index.html Normal file
View File

@@ -0,0 +1,15 @@
<!doctype html>
<html lang="en">
<head>
<script type="module" src="/@vite/client"></script>
<meta charset="utf-8">
<title>Web</title>
<base href="/">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" type="image/x-icon" href="favicon.ico">
<link rel="stylesheet" href="styles.css"></head>
<body>
<app-root></app-root>
<script src="main.js" type="module"></script></body>
</html>