[BREAKING] Pre-built images and Auto Updates

This commit is contained in:
Shiny Nematoda
2022-12-13 11:08:30 +00:00
parent f937cb515c
commit 82b56e1b6f
4 changed files with 26 additions and 56 deletions
+4 -16
View File
@@ -13,39 +13,27 @@ Make sure the following dependencies are met:
Clone the repo
```sh
$ git clone https://codeberg.org/Hyperpipe/Docker
git clone https://codeberg.org/Hyperpipe/Docker
cd Docker
```
Make the setup script executable
```sh
$ chmod u+x gen.sh
chmod u+x gen.sh
```
Run the setup script
```sh
$ ./gen.sh
./gen.sh
```
### Step 3 - Docker
*Run the following commands as root*
Build
```sh
$ docker-compose build
```
Start the container
```sh
$ docker-compose up
```
## Updating
Run the update script
```sh
$ ./update.sh
docker-compose up
```
## Cleaning
+17 -12
View File
@@ -2,23 +2,28 @@ version: '3'
services:
hyperpipe-frontend:
image: hyperpipe-frontend
image: codeberg.org/hyperpipe/hyperpipe:latest
container_name: hyperpipe-frontend
build:
context: ./Hyperpipe
args:
api: hyperpipeapi.onrender.com
pipedapi: pipedapi.kavin.rocks
restart: unless-stopped
entrypoint: sh -c 'find /usr/share/nginx/html -type f -exec sed -i s/pipedapi.kavin.rocks/PIPED/g {} \; -exec sed -i s/hyperpipeapi.onrender.org/BACKEND/g {} \; && /docker-entrypoint.sh && nginx -g "daemon off;"'
ports:
- '8080:80'
hyperpipe-backend:
image: hyperpipe-backend
image: codeberg.org/hyperpipe/hyperpipe-backend:latest
container_name: hyperpipe-backend
build:
context: ./hyperpipe-backend
args:
proxy: hyperpipe-proxy.onrender.com
environment:
- HYP_PROXY='hyperpipe-proxy.onrender.com'
restart: unless-stopped
ports:
- '3000:3000'
- '3000:3000'
watchtower:
image: containrrr/watchtower
container_name: watchtower
restart: always
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- /etc/timezone:/etc/timezone:ro
environment:
- WATCHTOWER_CLEANUP=true
- WATCHTOWER_INCLUDE_RESTARTING=true
command: hyperpipe-frontend hyperpipe-backend watchtower
+5 -8
View File
@@ -1,4 +1,7 @@
#!/bin/sh
set -e
printf "\nEnter hostname for Proxy (Same as the one used for Piped): " && read -r proxy
printf '\nFetching List of Hostnames for Backends (Hyperpipe) \n\n'
@@ -11,20 +14,14 @@ curl -s "https://piped-instances.kavin.rocks" | jq '.[].api_url|ltrimstr("https:
printf "\nEnter hostname for the default piped backend to be used: " && read -r piped
rm -rf ./Hyperpipe ./hyperpipe-backend
git clone --depth 1 https://codeberg.org/Hyperpipe/Hyperpipe.git
git clone --depth 1 https://codeberg.org/Hyperpipe/hyperpipe-backend
rm -f "*/docker-compose.yml"
cp docker-compose.template.yml docker-compose.yml
sed -i "s/hyperpipe-proxy.onrender.com/$proxy/g" docker-compose.yml
sed -i "s/pipedapi.kavin.rocks/$piped/g" docker-compose.yml
sed -i "s/PIPED/$piped/g" docker-compose.yml
sed -i "s/hyperpipeapi.onrender.com/$backend/g" docker-compose.yml
sed -i "s/BACKEND/$backend/g" docker-compose.yml
printf '\nDone!\n'
-20
View File
@@ -1,20 +0,0 @@
#!/bin/sh
set -x
sudo docker-compose down
cd Hyperpipe
rm -rf docker-compose.yml
git pull
cd ..
cd hyperpipe-backend
rm -rf docker-compose.yml
git pull
cd ..
sudo docker-compose build
sudo docker-compose up -d
echo "Do not forget to clear old docker data!"