mirror of
https://github.com/rommapp/romm.git
synced 2025-12-22 10:27:13 +00:00
Small changes to upgrade Python to version 3.13, and fixes based on a `pyupgrade` run using the `--py313-plus` flag.
91 lines
2.3 KiB
Docker
91 lines
2.3 KiB
Docker
# trunk-ignore-all(trivy)
|
|
# trunk-ignore-all(checkov)
|
|
|
|
FROM ubuntu:22.04
|
|
|
|
# Prevent interactive prompts during installation
|
|
ENV DEBIAN_FRONTEND=noninteractive
|
|
|
|
# Install system dependencies
|
|
RUN apt-get update && apt-get install -y --no-install-recommends \
|
|
git \
|
|
make \
|
|
gcc \
|
|
g++ \
|
|
libmariadb3 \
|
|
libmariadb-dev \
|
|
libpq-dev \
|
|
libffi-dev \
|
|
musl-dev \
|
|
curl \
|
|
ca-certificates \
|
|
libmagic-dev \
|
|
p7zip \
|
|
tzdata \
|
|
libbz2-dev \
|
|
libssl-dev \
|
|
libreadline-dev \
|
|
libsqlite3-dev \
|
|
zlib1g-dev \
|
|
liblzma-dev \
|
|
libncurses5-dev \
|
|
libncursesw5-dev \
|
|
&& apt-get clean \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
# Install pyenv
|
|
RUN curl -fsSL https://pyenv.run | bash
|
|
ENV PYENV_ROOT="/root/.pyenv"
|
|
ENV PATH="${PYENV_ROOT}/bin:${PYENV_ROOT}/shims:${PATH}"
|
|
|
|
# Install nvm
|
|
ENV NVM_DIR="/root/.nvm"
|
|
RUN curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.0/install.sh | bash \
|
|
&& . "$NVM_DIR/nvm.sh" \
|
|
&& nvm install 18.20.8 \
|
|
&& nvm use 18.20.8 \
|
|
&& nvm alias default 18.20.8
|
|
ENV PATH="$NVM_DIR/versions/node/v18.20.8/bin:$PATH"
|
|
|
|
# Build and install RAHasher (optional for RA hashes)
|
|
RUN git clone --recursive --branch 1.8.1 --depth 1 https://github.com/RetroAchievements/RALibretro.git /tmp/RALibretro
|
|
WORKDIR /tmp/RALibretro
|
|
RUN sed -i '22a #include <ctime>' ./src/Util.h \
|
|
&& sed -i '6a #include <unistd.h>' \
|
|
./src/libchdr/deps/zlib-1.3.1/gzlib.c \
|
|
./src/libchdr/deps/zlib-1.3.1/gzread.c \
|
|
./src/libchdr/deps/zlib-1.3.1/gzwrite.c \
|
|
&& make HAVE_CHD=1 -f ./Makefile.RAHasher \
|
|
&& cp ./bin64/RAHasher /usr/bin/RAHasher
|
|
RUN rm -rf /tmp/RALibretro
|
|
|
|
# Install frontend dependencies
|
|
COPY frontend/package.json /app/frontend/
|
|
WORKDIR /app/frontend
|
|
RUN npm install
|
|
|
|
# Set working directory
|
|
WORKDIR /app
|
|
|
|
# Install Python 3.13
|
|
RUN pyenv install 3.13 && pyenv global 3.13
|
|
|
|
# Install pipx and poetry for the non-root user
|
|
RUN pip3 install pipx poetry \
|
|
&& python3 -m pipx ensurepath
|
|
|
|
# Make poetry available to all users
|
|
ENV PATH="/usr/local/bin:$HOME/.local/bin:${PATH}"
|
|
|
|
# Copy project files (including pyproject.toml and poetry.lock)
|
|
COPY pyproject.toml poetry.lock* .python-version /app/
|
|
|
|
# Install Python dependencies
|
|
RUN poetry sync --all-extras
|
|
|
|
# Copy entrypoint script
|
|
COPY entrypoint.sh /entrypoint.sh
|
|
RUN chmod +x /entrypoint.sh
|
|
|
|
ENTRYPOINT ["/entrypoint.sh"]
|