Run please

This commit is contained in:
Michał Gdula 2023-09-12 12:13:44 +01:00
parent b53e58bd0d
commit 0ea8ab8cf1
8 changed files with 26 additions and 18 deletions

View file

@ -1,18 +1,27 @@
# syntax=docker/dockerfile:1 # syntax=docker/dockerfile:1
FROM alpine:3.18.2 FROM alpine:3.18.2
RUN mkdir /app && mkdir /app/data # Make a directory for the app
RUN mkdir /app
RUN mkdir /app/lynxie
WORKDIR /app WORKDIR /app
COPY ./lynxie /app # Copy the app files
COPY ./lynxie/ /app/lynxie/
COPY ./poetry.lock /app COPY ./poetry.lock /app
COPY ./pyproject.toml /app COPY ./pyproject.toml /app
# Install dependencies
RUN apk update RUN apk update
RUN apk --no-cache add python3 py3-pip curl RUN apk --no-cache add python3 py3-pip curl
# Install poetry
RUN curl -sSL https://install.python-poetry.org | python3 - RUN curl -sSL https://install.python-poetry.org | python3 -
RUN /root/.local/bin/poetry install RUN export PATH="/root/.local/bin:$PATH"
RUN /root/.local/bin/poetry run python3 database.py
CMD ["/root/.local/bin/poetry", "run", "python3", "main.py"] # Install the app
RUN poetry install
RUN poetry run python3 database.py
# Run the app
CMD ["poetry", "run", "python3", "main.py"]

View file

@ -4,8 +4,8 @@ from io import BytesIO
import discord import discord
from discord.ext import commands from discord.ext import commands
from .config import TINYFOX_ANIMALS from lynxie.config import TINYFOX_ANIMALS
from .utils import error_message from lynxie.utils import error_message
class Animals(commands.Cog): class Animals(commands.Cog):

View file

@ -5,8 +5,8 @@ import requests
import discord import discord
from discord.ext import commands from discord.ext import commands
from .config import E621_API_KEY, E621_USERNAME, E621_BLACKLIST from lynxie.config import E621_API_KEY, E621_USERNAME, E621_BLACKLIST
from .utils import error_message from lynxie.utils import error_message
_E621_AUTH = f"{E621_USERNAME}:{E621_API_KEY}".encode("utf-8") _E621_AUTH = f"{E621_USERNAME}:{E621_API_KEY}".encode("utf-8")

View file

@ -1,6 +1,6 @@
import discord import discord
from discord.ext import commands from discord.ext import commands
from .config import LYNXIE_PREFIX from lynxie.config import LYNXIE_PREFIX
class Help(commands.Cog): class Help(commands.Cog):

View file

@ -7,8 +7,8 @@ from PIL import Image, ImageEnhance
import discord import discord
from discord.ext import commands from discord.ext import commands
from .config import IMAGE_EXTENSIONS, IMAGE_OVERLAYS from lynxie.config import IMAGE_EXTENSIONS, IMAGE_OVERLAYS
from .utils import error_message from lynxie.utils import error_message
class Img(commands.Cog): class Img(commands.Cog):

View file

@ -1,7 +1,7 @@
import yt_dlp import yt_dlp
import discord import discord
from discord.ext import commands from discord.ext import commands
from .utils import error_message from lynxie.utils import error_message
ffmpeg_options = {"options": "-vn"} ffmpeg_options = {"options": "-vn"}

View file

@ -7,10 +7,10 @@ import discord
from discord.ext import commands from discord.ext import commands
from discord.gateway import DiscordWebSocket from discord.gateway import DiscordWebSocket
from .config import DISCORD_TOKEN, LYNXIE_PREFIX from config import DISCORD_TOKEN, LYNXIE_PREFIX
from .database import CommandHistory, Database from database import CommandHistory, Database
from .utils import mobile_status, error_message from utils import mobile_status, error_message
from .commands import Help, Ping, Hello, Music, Animals, Img, E621 from lynxie.commands import Help, Ping, Hello, Music, Animals, Img, E621
db = Database() db = Database()

View file

@ -3,7 +3,6 @@ name = "lynxie"
version = "0.1.0" version = "0.1.0"
description = "" description = ""
authors = ["Fluffy <michal-gdula@protonmail.com>"] authors = ["Fluffy <michal-gdula@protonmail.com>"]
readme = ".github/README.md"
[tool.poetry.dependencies] [tool.poetry.dependencies]
python = "^3.11" python = "^3.11"