Restructure project

This commit is contained in:
The0Mikkel
2024-05-27 23:37:31 +02:00
parent 03646b1142
commit 52515c81d9
6 changed files with 51 additions and 661 deletions

View File

@@ -1,11 +1,26 @@
FROM python:3.11.6-alpine
FROM python:3-alpine
# Set environment variables to prevent Python from writing .pyc files to disk and buffering stdout and stderr
ENV PYTHONDONTWRITEBYTECODE=1
ENV PYTHONUNBUFFERED=1
# Install dependencies needed for building Python packages
RUN apk add --no-cache build-base libffi-dev
RUN pip install poetry
WORKDIR /mnt
COPY pyproject.toml poetry.lock .
RUN poetry install --no-root --only main
# Create and set the working directory
WORKDIR /app
COPY . .
ENTRYPOINT ["poetry", "run", "python", "discollama.py"]
# Copy the requirements.txt file to the working directory
COPY requirements.txt .
# Install dependencies from requirements.txt
RUN pip install --no-cache-dir -r requirements.txt
COPY bot.py bot.py
# Create a non-root user and switch to it
RUN adduser -D myuser
USER myuser
# Command to run the application
ENTRYPOINT ["python", "bot.py"]