Add docker and node boilerplate

This commit is contained in:
walcutt 2024-02-27 21:27:31 -05:00
parent 3a2a023446
commit 4a23e18d83
7 changed files with 75 additions and 0 deletions

3
.gitignore vendored
View File

@ -128,3 +128,6 @@ dist
.yarn/build-state.yml
.yarn/install-state.gz
.pnp.*
# secrets
botkey.txt

13
asher/package-lock.json generated Normal file
View File

@ -0,0 +1,13 @@
{
"name": "asher-discord-bot",
"version": "0.0.0",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "asher-discord-bot",
"version": "0.0.0",
"license": "ISC"
}
}
}

20
asher/package.json Normal file
View File

@ -0,0 +1,20 @@
{
"name": "asher-discord-bot",
"version": "0.0.0",
"description": "best friends bot",
"main": "src/index.js",
"scripts": {
"serve": "node src/index.js",
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
"type": "git",
"url": "git+https://github.com/walcutt/asher.git"
},
"author": "walcutt",
"license": "ISC",
"bugs": {
"url": "https://github.com/walcutt/asher/issues"
},
"homepage": "https://github.com/walcutt/asher#readme"
}

1
asher/src/index.js Normal file
View File

@ -0,0 +1 @@
console.log("hello world!");

17
docker-compose.yml Normal file
View File

@ -0,0 +1,17 @@
version: "3.8"
services:
asher:
image: node:latest
restart: unless-stopped
init: true
volumes:
- ./asher:/asher
command: bash -c "cd /asher && npm i && npm run serve"
secrets:
- botkey
secrets:
botkey:
file: ./botkey.txt

15
docker-install.sh Normal file
View File

@ -0,0 +1,15 @@
# Add Docker's official GPG key:
sudo apt-get update
sudo apt-get install ca-certificates curl gnupg
sudo install -m 0755 -d /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
sudo chmod a+r /etc/apt/keyrings/docker.gpg
# Add the repository to Apt sources:
echo \
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \
$(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \
sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt-get update
sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin

6
src/package-lock.json generated Normal file
View File

@ -0,0 +1,6 @@
{
"name": "src",
"lockfileVersion": 3,
"requires": true,
"packages": {}
}