mirror of
https://github.com/rommapp/romm.git
synced 2026-06-28 06:46:00 +00:00
more dir creating up in dockerfile + add redis password
This commit is contained in:
@@ -28,6 +28,7 @@ DB_NAME: Final = os.environ.get("DB_NAME", "romm")
|
||||
# REDIS
|
||||
REDIS_HOST: Final = os.environ.get("REDIS_HOST", "127.0.0.1")
|
||||
REDIS_PORT: Final = os.environ.get("REDIS_PORT", 6379)
|
||||
REDIS_PASSWORD: Final = os.environ.get("REDIS_PASSWORD")
|
||||
|
||||
# IGDB
|
||||
IGDB_CLIENT_ID: Final = os.environ.get(
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import sys
|
||||
from enum import Enum
|
||||
|
||||
from config import REDIS_HOST, REDIS_PORT
|
||||
from config import REDIS_HOST, REDIS_PORT, REDIS_PASSWORD
|
||||
from logger.logger import log
|
||||
from redis import Redis
|
||||
from rq import Queue
|
||||
@@ -39,8 +39,8 @@ class FallbackCache:
|
||||
return repr(self)
|
||||
|
||||
|
||||
redis_client = Redis(host=REDIS_HOST, port=REDIS_PORT, db=0)
|
||||
redis_url = f"redis://{REDIS_HOST}:{REDIS_PORT}"
|
||||
redis_client = Redis(host=REDIS_HOST, port=REDIS_PORT, password=REDIS_PASSWORD, db=0)
|
||||
redis_url = f"redis://:{REDIS_PASSWORD}@{REDIS_HOST}:{REDIS_PORT}" if REDIS_PASSWORD else f"redis://{REDIS_HOST}:{REDIS_PORT}"
|
||||
|
||||
high_prio_queue = Queue(name=QueuePrio.HIGH.value, connection=redis_client)
|
||||
default_queue = Queue(name=QueuePrio.DEFAULT.value, connection=redis_client)
|
||||
@@ -54,6 +54,7 @@ else:
|
||||
cache = Redis(
|
||||
host=REDIS_HOST,
|
||||
port=REDIS_PORT,
|
||||
password=REDIS_PASSWORD,
|
||||
db=0,
|
||||
decode_responses=True,
|
||||
)
|
||||
|
||||
@@ -150,22 +150,20 @@ RUN rm -r \
|
||||
/docker-entrypoint.sh \
|
||||
/docker-entrypoint.d
|
||||
|
||||
# Move everything we prepared over to our final docker image
|
||||
FROM scratch
|
||||
COPY --from=production-stage / /
|
||||
|
||||
# User permissions
|
||||
RUN addgroup -g 1000 -S romm && adduser -u 1000 -D -S -G romm romm
|
||||
|
||||
# Create the directories and set ownership and permissions
|
||||
RUN mkdir /romm /redis-data && \
|
||||
chown romm:romm /romm /redis-data && \
|
||||
chmod 777 /romm /redis-data
|
||||
chown romm:romm /romm /redis-data /backend/handler/fixtures && \
|
||||
chmod -R 755 /romm /redis-data /backend/handler/fixtures
|
||||
|
||||
VOLUME /redis-data
|
||||
# Move everything we prepared over to our final docker image
|
||||
FROM scratch
|
||||
COPY --from=production-stage / /
|
||||
|
||||
# Set user to run as
|
||||
USER romm
|
||||
# Declare the supported volumes
|
||||
VOLUME ["/romm/resources", "/romm/library", "/romm/assets", "/romm/logs", "/romm/config", "/redis-data"]
|
||||
|
||||
# Expose ports and start
|
||||
EXPOSE 8080
|
||||
|
||||
@@ -38,6 +38,9 @@
|
||||
<Config Name="DB_USER" Target="DB_USER" Default="romm" Mode="" Description="Database user" Type="Variable" Display="advanced" Required="true" Mask="false"/>
|
||||
<Config Name="DB_NAME" Target="DB_NAME" Default="romm" Mode="" Description="Database name" Type="Variable" Display="advanced" Required="true" Mask="false"/>
|
||||
<Config Name="DB_PASSWD" Target="DB_PASSWD" Default="" Mode="" Description="Database password for DB_USER" Type="Variable" Display="advanced" Required="true" Mask="true"/>
|
||||
<Config Name="REDIS_HOST" Target="REDIS_HOST" Default="127.0.0.1" Mode="" Description="Redis host" Type="Variable" Display="advanced" Required="false" Mask="false"/>
|
||||
<Config Name="REDIS_PORT" Target="REDIS_PORT" Default="6379" Mode="" Description="Redis port" Type="Variable" Display="advanced" Required="false" Mask="false"/>
|
||||
<Config Name="REDIS_PASSWORD" Target="REDIS_PASSWORD" Default="" Mode="" Description="Redis password" Type="Variable" Display="advanced" Required="false" Mask="false"/>
|
||||
<Config Name="ROMM_AUTH_USERNAME" Target="ROMM_AUTH_USERNAME" Default="admin" Mode="" Description="Default admin username" Type="Variable" Display="advanced" Required="false" Mask="false"/>
|
||||
<Config Name="ROMM_AUTH_PASSWORD" Target="ROMM_AUTH_PASSWORD" Default="" Mode="" Description="Default admin password" Type="Variable" Display="advanced" Required="false" Mask="true"/>
|
||||
<Config Name="ROMM_AUTH_SECRET_KEY" Target="ROMM_AUTH_SECRET_KEY" Default="" Mode="" Description="Generate a key with `openssl rand -hex 32`" Type="Variable" Display="advanced" Required="false" Mask="true"/>
|
||||
|
||||
Reference in New Issue
Block a user