forked from wiktor/spejstore-new
fix: properly use threads and workers
This commit is contained in:
parent
2323263ccb
commit
ea5e223fcc
|
@ -18,3 +18,5 @@ build_static
|
||||||
.history
|
.history
|
||||||
log
|
log
|
||||||
.Dockerfile
|
.Dockerfile
|
||||||
|
.env
|
||||||
|
.devcontainer
|
||||||
|
|
10
Dockerfile
10
Dockerfile
|
@ -3,11 +3,11 @@ ENV PYTHONUNBUFFERED 1
|
||||||
RUN mkdir /code
|
RUN mkdir /code
|
||||||
WORKDIR /code
|
WORKDIR /code
|
||||||
RUN apt-get update && apt-get install -y --no-install-recommends \
|
RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||||
libpq-dev \
|
libpq-dev \
|
||||||
gcc \
|
gcc \
|
||||||
&& \
|
&& \
|
||||||
apt-get clean && \
|
apt-get clean && \
|
||||||
rm -rf /var/lib/apt/lists/*
|
rm -rf /var/lib/apt/lists/*
|
||||||
ADD requirements.txt /code/
|
ADD requirements.txt /code/
|
||||||
RUN pip install --no-cache-dir -r requirements.txt
|
RUN pip install --no-cache-dir -r requirements.txt
|
||||||
ADD . /code/
|
ADD . /code/
|
||||||
|
@ -15,4 +15,4 @@ ADD . /code/
|
||||||
RUN python -m pip install gunicorn
|
RUN python -m pip install gunicorn
|
||||||
|
|
||||||
RUN python manage.py collectstatic --no-input --clear
|
RUN python manage.py collectstatic --no-input --clear
|
||||||
CMD bash -c "python manage.py migrate && gunicorn -b 0.0.0.0:8000 --capture-output --error-logfile - --access-logfile - spejstore.wsgi:application"
|
CMD bash -c "python manage.py migrate && gunicorn --workers 1 --threads 4 -b 0.0.0.0:8000 --capture-output --error-logfile - --access-logfile - spejstore.wsgi:application"
|
||||||
|
|
|
@ -17,7 +17,7 @@ services:
|
||||||
web:
|
web:
|
||||||
build: .
|
build: .
|
||||||
restart: always
|
restart: always
|
||||||
command: bash -c "python manage.py migrate && gunicorn -b 0.0.0.0:8000 --capture-output --error-logfile - --access-logfile - spejstore.wsgi:application"
|
command: bash -c "python manage.py migrate && gunicorn --workers 1 --threads 4 -b 0.0.0.0:8000 --capture-output --error-logfile - --access-logfile - spejstore.wsgi:application"
|
||||||
volumes:
|
volumes:
|
||||||
- .:/code
|
- .:/code
|
||||||
- /code/build_static
|
- /code/build_static
|
||||||
|
|
Loading…
Reference in New Issue