devcontainer

This commit is contained in:
Riccardo Balbo 2024-07-25 20:13:26 +00:00
commit 1427fad9d5
3 changed files with 16 additions and 6 deletions

View file

@ -9,8 +9,13 @@
},
"mounts": [
"source=${localWorkspaceFolder}/.devcontainer/start.sh,target=/start-lnbits.sh,type=bind",
"source=${localWorkspaceFolder}/.devcontainer/setup.sh,target=/setup.sh,type=bind"
"source=${localWorkspaceFolder}/.devcontainer/setup.sh,target=/setup.sh,type=bind",
"source=/var/run/docker.sock,target=/var/run/docker.sock,type=bind"
],
"containerEnv": {
"IS_DEV_CONTAINER": "true",
},
"postCreateCommand": "/bin/bash /setup.sh ${containerWorkspaceFolder}",
"postStartCommand": "/bin/bash /start-lnbits.sh",
"forwardPorts": [
@ -22,5 +27,7 @@
"python.pythonPath": "/opt/python/bin/python3.9"
}
}
}
},
"runArgs": ["--network", "host"]
}

View file

@ -2,10 +2,11 @@
CONTAINER_WORKSPACE_FOLDER=$1
sudo apt update -y
sudo apt install -y python3.9-distutils curl
sudo apt-get install -y docker.io
curl -fsSL https://deb.nodesource.com/setup_20.x -o /tmp/nodesource_setup.sh
sudo bash /tmp/nodesource_setup.sh
sudo apt-get install -y nodejs
cd ..
if [ ! -d lnbits ] ; then
sudo git clone https://github.com/lnbits/lnbits.git;
fi
@ -18,6 +19,8 @@ sudo ln -s $VENV_PATH /opt/python
make bundle
poetry install --no-interaction
mkdir -p lnbits/extensions/
if [ ! -d lnbits/extensions/nwcprovider ] ; then
ln -s $CONTAINER_WORKSPACE_FOLDER lnbits/extensions/nwcprovider
fi

View file

@ -1,4 +1,4 @@
#!/bin/bash
ln -s $PWD/.devcontainer/.env ../lnbits/.env
cd ../lnbits
ln -s $PWD/.devcontainer/.env ./lnbits/.env
cd ./lnbits
poetry run lnbits