mirror of
https://github.com/Dispatcharr/Dispatcharr.git
synced 2026-01-23 02:35:14 +00:00
Merge branch 'main' of https://github.com/Dispatcharr/Dispatcharr
This commit is contained in:
commit
0868d51935
2 changed files with 22 additions and 1 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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'
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue