2024-07-20 11:40:43 +00:00
|
|
|
FROM python:3.12-slim-bookworm
|
2023-10-23 12:49:46 +00:00
|
|
|
ARG DEBIAN_FRONTEND=noninteractive
|
|
|
|
|
|
|
|
WORKDIR /usr/src/app
|
|
|
|
|
2024-07-14 18:04:01 +00:00
|
|
|
RUN apt-get update && \
|
2024-07-20 11:40:43 +00:00
|
|
|
apt-get install -y --no-install-recommends locales mariadb-client && \
|
2023-10-23 12:49:46 +00:00
|
|
|
sed -i -e 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen && \
|
2024-07-20 11:40:43 +00:00
|
|
|
dpkg-reconfigure locales && \
|
|
|
|
apt-get clean && \
|
|
|
|
rm -rf /var/lib/apt/lists/*
|
2023-10-23 12:49:46 +00:00
|
|
|
|
2024-07-14 16:07:00 +00:00
|
|
|
COPY pyproject.toml poetry.lock ./
|
2024-07-20 11:40:43 +00:00
|
|
|
RUN pip install --no-cache-dir poetry && \
|
2024-07-14 16:07:00 +00:00
|
|
|
poetry config virtualenvs.create false && \
|
2024-07-20 11:40:43 +00:00
|
|
|
poetry install --no-interaction --no-ansi --no-dev && \
|
|
|
|
pip cache purge
|
2023-10-23 12:49:46 +00:00
|
|
|
|
|
|
|
COPY . .
|
2024-08-22 12:54:31 +00:00
|
|
|
RUN rm -rf .venv
|
2023-10-23 12:49:46 +00:00
|
|
|
|
2024-07-20 11:44:11 +00:00
|
|
|
ENV LANG=en_US.UTF-8
|
|
|
|
ENV LC_ALL=en_US.UTF-8
|
2023-10-23 12:49:46 +00:00
|
|
|
|
2024-08-29 08:48:14 +00:00
|
|
|
CMD [ "poetry", "run", "python", "-O", "./main.py" ]
|