1
Fork 0
mirror of https://github.com/wlinator/luminara.git synced 2024-10-02 18:03:12 +00:00

chore: Change to python slim-bookworm

This commit is contained in:
wlinator 2024-07-20 07:40:43 -04:00
parent 51f454bb49
commit e0206a7b89
3 changed files with 10 additions and 15 deletions

View file

@ -1,17 +1,20 @@
FROM python:3.12
FROM python:3.12-slim-bookworm
ARG DEBIAN_FRONTEND=noninteractive
WORKDIR /usr/src/app
RUN apt-get update && \
apt-get install -y locales mariadb-client && \
apt-get install -y --no-install-recommends locales mariadb-client && \
sed -i -e 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen && \
dpkg-reconfigure locales
dpkg-reconfigure locales && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
COPY pyproject.toml poetry.lock ./
RUN pip install poetry && \
RUN pip install --no-cache-dir poetry && \
poetry config virtualenvs.create false && \
poetry install --no-interaction --no-ansi
poetry install --no-interaction --no-ansi --no-dev && \
pip cache purge
COPY . .

View file

@ -1,6 +1,6 @@
services:
core:
image: ghcr.io/wlinator/luminara:2
image: ghcr.io/wlinator/luminara:2 # Remove "ghcr.io/" if you want to use the Docker Hub image.
container_name: lumi-core
restart: always
env_file:

View file

@ -57,15 +57,7 @@ class Currency:
query = "SELECT user_id, balance FROM currency ORDER BY balance DESC"
data = database.select_query(query)
leaderboard = []
rank = 1
for row in data:
row_user_id = row[0]
balance = row[1]
leaderboard.append((row_user_id, balance, rank))
rank += 1
return leaderboard
return [(row[0], row[1], rank) for rank, row in enumerate(data, start=1)]
@staticmethod
def format(num):