first test
This commit is contained in:
11
CloudronManifest.json
Normal file
11
CloudronManifest.json
Normal file
@@ -0,0 +1,11 @@
|
||||
{
|
||||
"title": "Romm",
|
||||
"version": "0.1.0",
|
||||
"healthCheckPath": "/",
|
||||
"httpPort": 3000,
|
||||
"addons": {
|
||||
"localstorage": {},
|
||||
"postgresql": {}
|
||||
},
|
||||
"manifestVersion": 2
|
||||
}
|
||||
86
Dockerfile
Normal file
86
Dockerfile
Normal file
@@ -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 <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/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" ]
|
||||
|
||||
31
start.sh
Executable file
31
start.sh
Executable file
@@ -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 <<EOL
|
||||
ROMM_DB_DRIVER=postgresql
|
||||
DB_HOST=${CLOUDRON_POSTGRESQL_HOST}
|
||||
DB_PORT=${CLOUDRON_POSTGRESQL_PORT}
|
||||
DB_NAME=${CLOUDRON_POSTGRESQL_DATABASE}
|
||||
DB_USER=${CLOUDRON_POSTGRESQL_USERNAME}
|
||||
DB_PASSWD=${CLOUDRON_POSTGRESQL_PASSWORD}
|
||||
ROMM_AUTH_SECRET_KEY=${ROMM_AUTH_GEN}
|
||||
IGDB_CLIENT_ID=
|
||||
IGDB_CLIENT_SECRET=
|
||||
MOBYGAMES_API_KEY=
|
||||
STEAMGRIDDB_API_KEY=
|
||||
EOL
|
||||
|
||||
source /app/data/.env
|
||||
|
||||
echo "==> Starting supervisor"
|
||||
exec /usr/bin/supervisord --configuration /etc/supervisor/supervisord.conf --nodaemon -i Romm
|
||||
12
supervisor/backend.conf
Normal file
12
supervisor/backend.conf
Normal file
@@ -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
|
||||
12
supervisor/frontend.conf
Normal file
12
supervisor/frontend.conf
Normal file
@@ -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
|
||||
Reference in New Issue
Block a user