commit e52f8750b879ae8c4ad5c79812c00cf2c2f6f0d9 Author: Kevin Whitaker Date: Sat Jan 3 11:28:21 2026 -0500 first test diff --git a/CloudronManifest.json b/CloudronManifest.json new file mode 100644 index 0000000..c1eec74 --- /dev/null +++ b/CloudronManifest.json @@ -0,0 +1,11 @@ +{ + "title": "Romm", + "version": "0.1.0", + "healthCheckPath": "/", + "httpPort": 3000, + "addons": { + "localstorage": {}, + "postgresql": {} + }, + "manifestVersion": 2 +} diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..338a7a1 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,86 @@ +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 \ + unzip \ + && apt-get clean \ + && rm -rf /var/lib/apt/lists/* + +# Clone release +RUN wget https://github.com/rommapp/romm/archive/refs/tags/$VERSION.zip && \ +unzip $VERSION.zip -d /app/code && rm $VERSION.zip + +# 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 ' ./src/Util.h \ + && sed -i '6a #include ' \ + ./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/code/frontend/ +WORKDIR /app/code/frontend +RUN npm install + +# 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 uv python install 3.13 + + +# Copy project files (including pyproject.toml and uv.lock) +COPY pyproject.toml uv.lock* .python-version /app/code/ + +# Install Python dependencies +RUN uv sync --all-extras + +ENV PATH="/app/code/.venv/bin:${PATH}" + +COPY start.sh /app/pkg/ + +CMD [ "/app/pkg/start.sh" ] + diff --git a/logo.png b/logo.png new file mode 100644 index 0000000..cb59239 Binary files /dev/null and b/logo.png differ diff --git a/start.sh b/start.sh new file mode 100755 index 0000000..f5b5414 --- /dev/null +++ b/start.sh @@ -0,0 +1,31 @@ +#!/bin/bash +set -eu + +mkdir -p /app/data/library /app/data/config /app/data/assets /app/data/resources + +# ensure that data directory is owned by 'cloudron' user +chown -R cloudron:cloudron /app/data + +cd /app/data + +if [ ! -f /app/data/.env ]; then +## Write new .env to import on restarts of the app +ROMM_AUTH_GEN=$(/usr/bin/openssl rand -hex 32) +cat >/app/data/.env < Starting supervisor" +exec /usr/bin/supervisord --configuration /etc/supervisor/supervisord.conf --nodaemon -i Romm diff --git a/supervisor/backend.conf b/supervisor/backend.conf new file mode 100644 index 0000000..25fe984 --- /dev/null +++ b/supervisor/backend.conf @@ -0,0 +1,12 @@ +[program:backend] +priority=5 +directory=/app/code/backend +environment=HOME=/app/code +command=uv run python main.py +user=cloudron +autostart=true +autorestart=true +stdout_logfile=/dev/stdout +stdout_logfile_maxbytes=0 +stderr_logfile=/dev/stderr +stderr_logfile_maxbytes=0 diff --git a/supervisor/frontend.conf b/supervisor/frontend.conf new file mode 100644 index 0000000..e043c22 --- /dev/null +++ b/supervisor/frontend.conf @@ -0,0 +1,12 @@ +[program:backend] +priority=5 +directory=/app/code/frontend +environment=HOME=/app/code +command=npm run prod +user=cloudron +autostart=true +autorestart=true +stdout_logfile=/dev/stdout +stdout_logfile_maxbytes=0 +stderr_logfile=/dev/stderr +stderr_logfile_maxbytes=0