Merge pull request #693 from felipecrs/add-docker
Add docker to the devcontainer
This commit is contained in:
@@ -0,0 +1,10 @@
|
|||||||
|
FROM mcr.microsoft.com/vscode/devcontainers/javascript-node:0-16
|
||||||
|
|
||||||
|
# Install Docker
|
||||||
|
ENV DOCKER_BUILDKIT="1"
|
||||||
|
# https://github.com/microsoft/vscode-dev-containers/commits/main/script-library/docker-debian.sh
|
||||||
|
ARG DOCKER_SCRIPT_VERSION="364972b0d7d20ee5de40c1084e65f3f1bc6d5951"
|
||||||
|
RUN bash -c "$(curl -fsSL "https://raw.githubusercontent.com/microsoft/vscode-dev-containers/${DOCKER_SCRIPT_VERSION}/script-library/docker-debian.sh")" \
|
||||||
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
|
ENTRYPOINT ["/usr/local/share/docker-init.sh"]
|
||||||
|
CMD ["sleep", "infinity"]
|
||||||
@@ -1,8 +1,8 @@
|
|||||||
// See https://aka.ms/vscode-remote/devcontainer.json for format details.
|
// See https://aka.ms/vscode-remote/devcontainer.json for format details.
|
||||||
{
|
{
|
||||||
"dockerComposeFile": "docker-compose.yml",
|
"dockerComposeFile": "../docker-compose.yml",
|
||||||
"service": "dev",
|
"service": "dev",
|
||||||
"workspaceFolder": "/workspace",
|
"workspaceFolder": "${localWorkspaceFolder}",
|
||||||
"shutdownAction": "stopCompose",
|
"shutdownAction": "stopCompose",
|
||||||
"portsAttributes": {
|
"portsAttributes": {
|
||||||
"41000": {
|
"41000": {
|
||||||
@@ -10,7 +10,7 @@
|
|||||||
"onAutoForward": "silent"
|
"onAutoForward": "silent"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"initializeCommand": "git submodule update --init",
|
"initializeCommand": ".devcontainer/initialize.sh",
|
||||||
"postCreateCommand": "yarn install",
|
"postCreateCommand": "yarn install",
|
||||||
"extensions": [
|
"extensions": [
|
||||||
"github.vscode-pull-request-github",
|
"github.vscode-pull-request-github",
|
||||||
@@ -21,7 +21,8 @@
|
|||||||
"runem.lit-plugin",
|
"runem.lit-plugin",
|
||||||
"davidanson.vscode-markdownlint",
|
"davidanson.vscode-markdownlint",
|
||||||
"redhat.vscode-yaml",
|
"redhat.vscode-yaml",
|
||||||
"lokalise.i18n-ally"
|
"lokalise.i18n-ally",
|
||||||
|
"ms-azuretools.vscode-docker"
|
||||||
],
|
],
|
||||||
"settings": {
|
"settings": {
|
||||||
"files.eol": "\n",
|
"files.eol": "\n",
|
||||||
|
|||||||
@@ -1,26 +0,0 @@
|
|||||||
---
|
|
||||||
version: '3'
|
|
||||||
services:
|
|
||||||
dev:
|
|
||||||
user: node
|
|
||||||
image: mcr.microsoft.com/vscode/devcontainers/javascript-node:0-16
|
|
||||||
ports:
|
|
||||||
# Rollup
|
|
||||||
- 41000:41000
|
|
||||||
volumes:
|
|
||||||
- ..:/workspace:cached
|
|
||||||
command: [sleep, infinity]
|
|
||||||
hass:
|
|
||||||
extends:
|
|
||||||
file: ./frigate-hass-integration/docker-compose.yml
|
|
||||||
service: hass
|
|
||||||
volumes:
|
|
||||||
- ./preconfig:/preconfig.d/02-card:ro
|
|
||||||
frigate:
|
|
||||||
extends:
|
|
||||||
file: ./frigate-hass-integration/docker-compose.yml
|
|
||||||
service: frigate
|
|
||||||
mqtt:
|
|
||||||
extends:
|
|
||||||
file: ./frigate-hass-integration/docker-compose.yml
|
|
||||||
service: mqtt
|
|
||||||
Executable
+18
@@ -0,0 +1,18 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
set -euo 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
|
||||||
@@ -0,0 +1,29 @@
|
|||||||
|
---
|
||||||
|
version: '3'
|
||||||
|
services:
|
||||||
|
dev:
|
||||||
|
user: node
|
||||||
|
init: true
|
||||||
|
build: .devcontainer
|
||||||
|
ports:
|
||||||
|
# Rollup
|
||||||
|
- 41000:41000
|
||||||
|
env_file:
|
||||||
|
- .env
|
||||||
|
volumes:
|
||||||
|
- /var/run/docker.sock:/var/run/docker-host.sock
|
||||||
|
- .:${LOCAL_WORKSPACE_FOLDER}:cached
|
||||||
|
hass:
|
||||||
|
extends:
|
||||||
|
file: .devcontainer/frigate-hass-integration/docker-compose.yml
|
||||||
|
service: hass
|
||||||
|
volumes:
|
||||||
|
- .devcontainer/preconfig:/preconfig.d/02-card:ro
|
||||||
|
frigate:
|
||||||
|
extends:
|
||||||
|
file: .devcontainer/frigate-hass-integration/docker-compose.yml
|
||||||
|
service: frigate
|
||||||
|
mqtt:
|
||||||
|
extends:
|
||||||
|
file: .devcontainer/frigate-hass-integration/docker-compose.yml
|
||||||
|
service: mqtt
|
||||||
Reference in New Issue
Block a user