2024-06-11 05:18:25 +00:00
|
|
|
FROM python:3.12-slim
|
|
|
|
|
|
|
|
WORKDIR /app
|
|
|
|
|
|
|
|
# Install dependencies for cairo and other utilities
|
2024-07-02 21:09:07 +00:00
|
|
|
RUN apt-get update && \
|
|
|
|
apt-get install -y \
|
2024-07-02 02:23:17 +00:00
|
|
|
libcairo2 \
|
|
|
|
libpango1.0-0 \
|
|
|
|
libpangocairo-1.0-0 \
|
|
|
|
libgdk-pixbuf2.0-0 \
|
|
|
|
libffi-dev \
|
|
|
|
shared-mime-info \
|
|
|
|
curl \
|
2024-07-02 21:09:07 +00:00
|
|
|
build-essential && \
|
|
|
|
apt-get clean && \
|
2024-07-02 02:23:17 +00:00
|
|
|
rm -rf /var/lib/apt/lists/*
|
2024-06-11 05:18:25 +00:00
|
|
|
|
2024-06-11 05:29:33 +00:00
|
|
|
# Install Rust and Cargo
|
|
|
|
RUN curl https://sh.rustup.rs -sSf | sh -s -- -y
|
|
|
|
ENV PATH="/root/.cargo/bin:${PATH}"
|
|
|
|
|
|
|
|
# Install tealdeer and update tldr cache
|
|
|
|
RUN cargo install tealdeer
|
|
|
|
RUN tldr -u
|
|
|
|
|
2024-06-11 05:18:25 +00:00
|
|
|
# Copy Poetry files and install dependencies
|
|
|
|
COPY pyproject.toml poetry.lock /app/
|
2024-07-02 21:09:07 +00:00
|
|
|
RUN pip install poetry && \
|
|
|
|
poetry config virtualenvs.create false && \
|
2024-07-02 02:23:17 +00:00
|
|
|
poetry install --no-interaction --no-ansi
|
2024-06-11 05:18:25 +00:00
|
|
|
|
|
|
|
# Copy the remaining project files
|
|
|
|
COPY . /app
|
|
|
|
|
|
|
|
RUN mkdir -p /app/.cache/prisma && chmod +x /app/.cache/prisma
|
|
|
|
|
|
|
|
# Set PYTHONPATH environment variable to /app
|
|
|
|
ENV PYTHONPATH=/app
|
|
|
|
|
|
|
|
# Removing entrypoint and using CMD instead for better debugging
|
2024-07-02 21:09:07 +00:00
|
|
|
CMD ["sh", "-c", "ls && poetry run prisma generate && poetry run python tux/main.py"]
|