Add a setup script and docker-compose

This commit is contained in:
Skylar Grant 2024-09-22 13:46:29 -04:00
parent 35405f3817
commit 503d2029ff
3 changed files with 49 additions and 0 deletions

8
Dockerfile Normal file
View File

@ -0,0 +1,8 @@
FROM node:20
RUN mkdir -p /usr/src/app
WORKDIR /usr/src/app
COPY package.json ./
RUN npm install
COPY . .
CMD ["/bin/sh", "-c", "node src/index.js 2>&1 > /logs/$(date +%Y-%m-%d_%H-%M-%S).txt"]

22
docker-compose.yml Normal file
View File

@ -0,0 +1,22 @@
version: '3.8'
networks:
proxnet:
external: true
services:
proxy:
image: 'v0idf1sh/hookshot'
container_name: hookshot
restart: unless-stopped
networks:
- proxnet
environment:
- TOPGG_WH_ID: "id"
- TOPGG_WH_TOKEN: "token"
- UPTIMEKUMA_WH_ID: "id"
- UPTIMEKUMA_WH_TOKEN: "token"
- TESTING_WH_ID: "id"
- TESTING_WH_TOKEN: "token"
volumes:
- ./logs:/logs # Log files

19
setup.sh Normal file
View File

@ -0,0 +1,19 @@
#!/bin/bash
# Check for root
if [ "$EUID" -ne 0 ]
then echo "Please run as root"
exit
fi
# Create directories if they don't exist
mkdir -p /srv/docker/hookshot/logs
# Copy the docker-compose.yml file
cp docker-compose.yml /srv/docker/hookshot/docker-compose.yml
# Open the docker-compose.yml file for editing
nano /srv/docker/hookshot/docker-compose.yml
# Start the containers
docker-compose -f /srv/docker/hookshot/docker-compose.yml up -d