Merge pull request #756 from felipecrs/refresh-devcontainer

Refresh the devcontainer
This commit is contained in:
Dermot Duffy
2022-07-05 21:22:44 -07:00
committed by GitHub
7 changed files with 18 additions and 23 deletions
+10 -1
View File
@@ -5,11 +5,20 @@
"workspaceFolder": "${localWorkspaceFolder}", "workspaceFolder": "${localWorkspaceFolder}",
"shutdownAction": "stopCompose", "shutdownAction": "stopCompose",
"portsAttributes": { "portsAttributes": {
"41000": { "1000": {
"label": "Rollup", "label": "Rollup",
"onAutoForward": "silent" "onAutoForward": "silent"
},
"hass:8123": {
"label": "Home Assistant",
"onAutoForward": "silent"
},
"frigate:5000": {
"label": "Frigate",
"onAutoForward": "silent"
} }
}, },
"forwardPorts": [1000, "hass:8123", "frigate:5000"],
"initializeCommand": ".devcontainer/initialize.sh", "initializeCommand": ".devcontainer/initialize.sh",
"postCreateCommand": "yarn install", "postCreateCommand": "yarn install",
"extensions": [ "extensions": [
+3 -14
View File
@@ -1,18 +1,7 @@
#!/bin/bash #!/bin/bash
set -euo pipefail set -euxo pipefail
readonly wanted_line_key="LOCAL_WORKSPACE_FOLDER"
readonly wanted_line="${wanted_line_key}='${PWD}'"
readonly file=".env"
echo "Writing ${wanted_line} to ${file}" >&2
if [[ -f "${file}" ]] && grep --quiet "^${wanted_line_key}=" "${file}"; then
sed --in-place "s,^${wanted_line_key}=.*,${wanted_line}," "${file}"
else
echo "${wanted_line}" >>"${file}"
fi
set -x
git submodule update --init git submodule update --init
.devcontainer/frigate-hass-integration/.devcontainer/set_dot_env.sh
@@ -5,7 +5,7 @@
"data": { "data": {
"items": [ "items": [
{ {
"url": "http://localhost:41000/frigate-hass-card.js", "url": "http://localhost:1000/frigate-hass-card.js",
"type": "module", "type": "module",
"id": "00c459541bac4290af01c51bf9c06ba1" "id": "00c459541bac4290af01c51bf9c06ba1"
} }
+2 -2
View File
@@ -5,10 +5,10 @@
"type": "pwa-chrome", "type": "pwa-chrome",
"request": "launch", "request": "launch",
"name": "Launch Chrome against Home Assistant", "name": "Launch Chrome against Home Assistant",
"url": "http://localhost:48123", "url": "http://localhost:8123",
"webRoot": "${workspaceFolder}/dist", "webRoot": "${workspaceFolder}/dist",
"preLaunchTask": "Rollup", "preLaunchTask": "Rollup",
"resolveSourceMapLocations": ["http://localhost:41000/**"] "resolveSourceMapLocations": ["http://localhost:1000/**"]
} }
] ]
} }
-3
View File
@@ -5,9 +5,6 @@ services:
user: node user: node
init: true init: true
build: .devcontainer build: .devcontainer
ports:
# Rollup
- 41000:41000
env_file: env_file:
- .env - .env
volumes: volumes:
+1 -1
View File
@@ -19,7 +19,7 @@ const dev = watch || process.env.DEV === 'true' || process.env.DEV === '1';
const serveopts = { const serveopts = {
contentBase: ['./dist'], contentBase: ['./dist'],
host: '0.0.0.0', host: '0.0.0.0',
port: 41000, port: 1000,
allowCrossOrigin: true, allowCrossOrigin: true,
headers: { headers: {
'Access-Control-Allow-Origin': '*', 'Access-Control-Allow-Origin': '*',