From 666cdb113e728de1a379605a48f223fcbeb4468c Mon Sep 17 00:00:00 2001 From: Fluffy-Bean Date: Tue, 12 Sep 2023 12:24:53 +0100 Subject: [PATCH] I think this is all now --- Bot/Dockerfile | 9 ++++----- Bot/lynxie/config.py | 4 ++-- Bot/lynxie/database.py | 2 +- Bot/lynxie/main.py | 6 +++--- Bot/lynxie/utils.py | 2 +- 5 files changed, 11 insertions(+), 12 deletions(-) diff --git a/Bot/Dockerfile b/Bot/Dockerfile index 024a882..06a38bc 100644 --- a/Bot/Dockerfile +++ b/Bot/Dockerfile @@ -7,7 +7,7 @@ RUN mkdir /app/lynxie WORKDIR /app # Copy the app files -COPY ./lynxie/ /app/lynxie/ +COPY ./lynxie /app/lynxie COPY ./poetry.lock /app COPY ./pyproject.toml /app @@ -17,11 +17,10 @@ RUN apk --no-cache add python3 py3-pip curl # Install poetry RUN curl -sSL https://install.python-poetry.org | python3 - -RUN export PATH="/root/.local/bin:$PATH" # Install the app -RUN poetry install -RUN poetry run python3 database.py +RUN /root/.local/bin/poetry install +RUN /root/.local/bin/poetry run python3 /app/lynxie/database.py # Run the app -CMD ["poetry", "run", "python3", "main.py"] +CMD ["/root/.local/bin/poetry", "run", "python3", "/app/lynxie/main.py"] diff --git a/Bot/lynxie/config.py b/Bot/lynxie/config.py index 8497e8c..3373ad3 100644 --- a/Bot/lynxie/config.py +++ b/Bot/lynxie/config.py @@ -15,8 +15,8 @@ DISCORD_TOKEN = ( DISCORD_GUILD_ID = Object(id=1040757387033849976) LYNXIE_PREFIX = "?" -DATA_PATH = os.path.join("/app", "data") -ASSETS_PATH = os.path.join("/app", "assets") +DATA_PATH = os.path.join("lynxie", "data") +ASSETS_PATH = os.path.join("lynxie", "assets") DATABASE_URI = "sqlite:///" + os.path.join(DATA_PATH, "lynxie.db") diff --git a/Bot/lynxie/database.py b/Bot/lynxie/database.py index f662df0..b41badd 100644 --- a/Bot/lynxie/database.py +++ b/Bot/lynxie/database.py @@ -1,6 +1,6 @@ from sqlalchemy import create_engine, Column, Integer, String, DateTime from sqlalchemy.orm import declarative_base, sessionmaker -from .config import DATABASE_URI +from lynxie.config import DATABASE_URI Base = declarative_base() diff --git a/Bot/lynxie/main.py b/Bot/lynxie/main.py index e03ff48..dfe9ce0 100644 --- a/Bot/lynxie/main.py +++ b/Bot/lynxie/main.py @@ -7,9 +7,9 @@ import discord from discord.ext import commands from discord.gateway import DiscordWebSocket -from config import DISCORD_TOKEN, LYNXIE_PREFIX -from database import CommandHistory, Database -from utils import mobile_status, error_message +from lynxie.config import DISCORD_TOKEN, LYNXIE_PREFIX +from lynxie.database import CommandHistory, Database +from lynxie.utils import mobile_status, error_message from lynxie.commands import Help, Ping, Hello, Music, Animals, Img, E621 diff --git a/Bot/lynxie/utils.py b/Bot/lynxie/utils.py index a624c7b..59a5eeb 100644 --- a/Bot/lynxie/utils.py +++ b/Bot/lynxie/utils.py @@ -1,7 +1,7 @@ import sys import discord from discord.gateway import _log -from .config import LYNXIE_PREFIX +from lynxie.config import LYNXIE_PREFIX async def mobile_status(self):