mirror of https://github.com/coddrago/Heroku
parent
27aff587f6
commit
4ff72021cb
15
Dockerfile
15
Dockerfile
|
@ -1,12 +1,19 @@
|
|||
FROM python:3.8-slim-buster as main
|
||||
FROM python:3.8-slim as python-base
|
||||
ENV DOCKER=true
|
||||
ENV GIT_PYTHON_REFRESH=quiet
|
||||
ENV PIP_NO_CACHE_DIR=1
|
||||
RUN apt update && apt install libcairo2 git -y --no-install-recommends
|
||||
|
||||
ENV PIP_NO_CACHE_DIR=1 \
|
||||
PYTHONUNBUFFERED=1 \
|
||||
PYTHONDONTWRITEBYTECODE=1
|
||||
|
||||
RUN apt update && apt install libcairo2 git build-essential -y --no-install-recommends
|
||||
RUN rm -rf /var/lib/apt/lists /var/cache/apt/archives /tmp/*
|
||||
RUN git clone https://github.com/hikariatama/Hikka /Hikka
|
||||
|
||||
WORKDIR /Hikka
|
||||
RUN pip install --no-warn-script-location --no-cache-dir -r requirements.txt
|
||||
|
||||
EXPOSE 8080
|
||||
RUN mkdir /data
|
||||
CMD ["python3", "-m", "hikka"]
|
||||
|
||||
CMD python -m hikka
|
||||
|
|
|
@ -1,9 +1,16 @@
|
|||
version: "3"
|
||||
services:
|
||||
worker:
|
||||
build: .
|
||||
container_name: "hikka-worker"
|
||||
build:
|
||||
context: .
|
||||
volumes:
|
||||
- worker:/data
|
||||
|
||||
stop_signal: SIGINT
|
||||
restart: unless-stopped
|
||||
command: "python -m hikka"
|
||||
ports:
|
||||
- "${EXTERNAL_PORT:-8080}:8080"
|
||||
|
||||
volumes:
|
||||
worker:
|
||||
|
|
|
@ -0,0 +1,52 @@
|
|||
#!/bin/bash
|
||||
|
||||
PORT=3429 # Port to run the server on
|
||||
echo "EXTERNAL_PORT=$PORT" >.env
|
||||
|
||||
if ! [ -x "$(command -v docker)" ]; then
|
||||
printf "\033[0;34mInstalling docker...\e[0m"
|
||||
if [ -f /etc/debian_version ]; then
|
||||
sudo apt-get install \
|
||||
apt-transport-https \
|
||||
ca-certificates \
|
||||
curl \
|
||||
gnupg-agent \
|
||||
software-properties-common
|
||||
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
|
||||
sudo add-apt-repository \
|
||||
"deb [arch=amd64] https://download.docker.com/linux/ubuntu \
|
||||
$(lsb_release -cs) \
|
||||
stable"
|
||||
sudo apt-get update
|
||||
sudo apt-get install docker-ce docker-ce-cli containerd.io
|
||||
elif [ -f /etc/arch-release ]; then
|
||||
sudo pacman -Syu docker
|
||||
elif [ -f /etc/redhat-release ]; then
|
||||
sudo yum install -y yum-utils
|
||||
sudo yum-config-manager \
|
||||
--add-repo \
|
||||
https://download.docker.com/linux/centos/docker-ce.repo
|
||||
sudo yum install docker-ce docker-ce-cli containerd.io
|
||||
fi
|
||||
printf "\033[0;32m - success\e[0m\n"
|
||||
else
|
||||
printf "\033[0;32mDocker is already installed\e[0m\n"
|
||||
fi
|
||||
|
||||
printf "\033[0;34mDownloading configuration files...\e[0m"
|
||||
if [ -f "Dockerfile" ]; then
|
||||
rm Dockerfile
|
||||
fi
|
||||
wget -q https://github.com/hikariatama/Hikka/raw/master/Dockerfile
|
||||
if [ -f "docker-compose.yml" ]; then
|
||||
rm docker-compose.yml
|
||||
fi
|
||||
wget -q https://github.com/hikariatama/Hikka/raw/master/docker-compose.yml
|
||||
printf "\033[0;32m - success\e[0m\n"
|
||||
|
||||
printf "\033[0;34mBuilding docker image...\e[0m"
|
||||
docker-compose up -d --build 1>/dev/null 2>&1
|
||||
printf "\033[0;32m - success\e[0m\n"
|
||||
|
||||
printf "\033[0;32mFollow this url to continue installation:\e[0m\n"
|
||||
ssh "-o StrictHostKeyChecking=no" "-R 80:127.0.0.1:$PORT" "nokey@localhost.run" 2>&1 | grep "tunneled"
|
Loading…
Reference in New Issue