Create dockerfile for bot. Add bot to compose.
This commit is contained in:
+16
-1
@@ -2,7 +2,7 @@ version: "3"
|
|||||||
services:
|
services:
|
||||||
sqldb:
|
sqldb:
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
image: "highscores_db"
|
build: docker/MySql
|
||||||
container_name: "Highscores-DataBase"
|
container_name: "Highscores-DataBase"
|
||||||
volumes:
|
volumes:
|
||||||
- highscores_data:/var/lib/mysql
|
- highscores_data:/var/lib/mysql
|
||||||
@@ -12,5 +12,20 @@ services:
|
|||||||
- MYSQL_ROOT_PASSWORD=${SQL_PASS}
|
- MYSQL_ROOT_PASSWORD=${SQL_PASS}
|
||||||
- MYSQL_ROOT_USERNAME=${SQL_USER}
|
- MYSQL_ROOT_USERNAME=${SQL_USER}
|
||||||
|
|
||||||
|
bot:
|
||||||
|
restart: unless-stopped
|
||||||
|
build:
|
||||||
|
context: ./
|
||||||
|
dockerfile: ./docker/Highscores_Bot/Dockerfile
|
||||||
|
container_name: "Highscores-Bot"
|
||||||
|
depends_on:
|
||||||
|
- sqldb
|
||||||
|
environment:
|
||||||
|
- DISCORD_TOKEN=${DISCORD_TOKEN}
|
||||||
|
- SQL_DB=${SQL_DB}
|
||||||
|
- SQL_HOST=${SQL_HOST}
|
||||||
|
- SQL_PASS=${SQL_PASS}
|
||||||
|
- SQL_USER=${SQL_USER}
|
||||||
|
|
||||||
volumes:
|
volumes:
|
||||||
highscores_data:
|
highscores_data:
|
||||||
|
|||||||
@@ -0,0 +1,23 @@
|
|||||||
|
FROM python:3.8.10-alpine3.14
|
||||||
|
|
||||||
|
# need to install build dependencies
|
||||||
|
RUN apk add --no-cache --update python3 mariadb-connector-c-dev \
|
||||||
|
&& apk add --no-cache --update --virtual build-deps python3-dev g++ gfortran musl-dev \
|
||||||
|
libffi-dev openssl-dev mariadb-dev
|
||||||
|
|
||||||
|
# upgrade pip
|
||||||
|
RUN pip install --upgrade pip
|
||||||
|
|
||||||
|
WORKDIR /home
|
||||||
|
|
||||||
|
COPY classes classes/
|
||||||
|
COPY cogs cogs/
|
||||||
|
COPY utilities utilities/
|
||||||
|
COPY highscores.py highscores.py
|
||||||
|
COPY requirements.txt requirements.txt
|
||||||
|
|
||||||
|
RUN pip install -r requirements.txt
|
||||||
|
|
||||||
|
RUN apk del build-deps
|
||||||
|
|
||||||
|
CMD ["python3", "./highscores.py"]
|
||||||
+1
-1
@@ -2,4 +2,4 @@ nextcord>=2.3.2
|
|||||||
python-dotenv>=0.20.0
|
python-dotenv>=0.20.0
|
||||||
pandas>=1.5.2
|
pandas>=1.5.2
|
||||||
sqlalchemy>=1.4.44
|
sqlalchemy>=1.4.44
|
||||||
mysqlclient>-2.1.1
|
mysqlclient>=2.1.1
|
||||||
Reference in New Issue
Block a user