92 lines
2.9 KiB
Docker
92 lines
2.9 KiB
Docker
FROM cloudron/base:5.0.0@sha256:04fd70dbd8ad6149c19de39e35718e024417c3e01dc9c6637eaf4a41ec4e596c
|
|
|
|
RUN mkdir -p /app/code
|
|
WORKDIR /app/code
|
|
ARG VERSION=4.5.0
|
|
|
|
# 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 \
|
|
7zip \
|
|
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/*
|
|
|
|
# Clone release
|
|
RUN wget https://github.com/rommapp/romm/archive/refs/tags/$VERSION.tar.gz && \
|
|
tar xfz $VERSION.tar.gz --strip-components=1 -C /app/code && rm $VERSION.tar.gz && rm -rf /app/code/backend/romm_test
|
|
|
|
# Install nvm
|
|
ENV NVM_DIR="/app/code/.nvm"
|
|
RUN mkdir -p $NVM_DIR
|
|
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
|
|
WORKDIR /app/code/frontend
|
|
RUN npm install
|
|
RUN ln -s /tmp/vite-temp /app/code/frontend/node_modules/.vite-temp && ln -s /tmp/vite /app/code/frontend/node_modules/.vite && mkdir assets/romm && ln -s /app/data/assets /app/code/frontend/assets/romm/assets && ln -s /app/data/resources /app/code/frontend/assets/romm/resources
|
|
COPY --from=docker.io/rommapp/romm:$VERSION /var/www/html/assets/emulatorjs /app/code/frontend/assets/emulatorjs
|
|
COPY --from=docker.io/rommapp/romm:$VERSION /var/www/html/assets/ruffle /app/code/frontend/assets/ruffle
|
|
|
|
WORKDIR /app/code/
|
|
# Install uv for the non-root user
|
|
COPY --from=ghcr.io/astral-sh/uv:0.7.19 /uv /uvx /usr/local/bin/
|
|
|
|
# Install Python
|
|
RUN mkdir /app/code/uv && uv python install -i /app/code/uv 3.13
|
|
|
|
# Install Python dependencies
|
|
ENV UV_PYTHON_INSTALL_DIR=/app/code/uv
|
|
RUN uv sync --all-extras
|
|
|
|
# add supervisor configs
|
|
ADD supervisor/* /etc/supervisor/conf.d/
|
|
RUN ln -sf /run/supervisord.log /var/log/supervisor/supervisord.log
|
|
|
|
ENV PATH="/app/code/.venv/bin:${PATH}"
|
|
|
|
COPY start.sh /app/pkg/
|
|
COPY env.sh.template /app/pkg/
|
|
|
|
CMD [ "/app/pkg/start.sh" ]
|
|
|