From 00d89d9a7dfa7242a3838420ecbd8b6df50d70a5 Mon Sep 17 00:00:00 2001 From: SergeantPanda Date: Sat, 1 Mar 2025 20:39:57 -0600 Subject: [PATCH] Changed entrypoint port back to 9191 and added build commands for react to dockerfileAIO --- docker/DockerfileAIO | 21 +++++++++++++++++++++ docker/entrypoint.sh | 2 +- 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/docker/DockerfileAIO b/docker/DockerfileAIO index 86c9d33b..eddba184 100755 --- a/docker/DockerfileAIO +++ b/docker/DockerfileAIO @@ -17,8 +17,12 @@ RUN apt-get update && apt-get install -y \ postgresql-14 \ postgresql-contrib-14 \ redis-server \ + npm \ + nodejs \ && rm -rf /var/lib/apt/lists/* + + # Set the working directory WORKDIR /app @@ -31,6 +35,23 @@ RUN pip install --no-cache-dir -r /app/requirements.txt # Copy the application source code from the parent directory COPY . /app/ +# Build frontend react +RUN cd /app/frontend && \ + npm install && \ + npm run build && \ + find . -maxdepth 1 ! -name '.' ! -name 'build' -exec rm -rf '{}' \; && \ + cd /app && \ + python manage.py collectstatic --noinput || true + +# Cleanup +RUN apt-get purge -y \ + nodejs \ + npm \ + gcc \ + && apt-get autoremove -y \ + && apt-get clean \ + && rm -rf /var/lib/apt/lists/* + # Set environment variables ENV DJANGO_SETTINGS_MODULE=dispatcharr.settings ENV PYTHONUNBUFFERED=1 diff --git a/docker/entrypoint.sh b/docker/entrypoint.sh index bb64bfe7..334eb608 100755 --- a/docker/entrypoint.sh +++ b/docker/entrypoint.sh @@ -131,4 +131,4 @@ su - $POSTGRES_USER -c 'cd /app && celery -A dispatcharr worker --loglevel=info # Start Gunicorn echo_with_timestamp "Starting Gunicorn..." -su - $POSTGRES_USER -c 'cd /app && gunicorn --workers=4 --worker-class=gevent --timeout=300 --bind 0.0.0.0:5656 dispatcharr.wsgi:application' +su - $POSTGRES_USER -c 'cd /app && gunicorn --workers=4 --worker-class=gevent --timeout=300 --bind 0.0.0.0:9191 dispatcharr.wsgi:application'