mirror of
https://github.com/shouptech/humulus.git
synced 2026-02-03 12:39:42 +00:00
Use uwsgi for docker container
This commit is contained in:
parent
9a33feef7a
commit
705f84d3cb
1 changed files with 21 additions and 9 deletions
30
Dockerfile
30
Dockerfile
|
|
@ -1,13 +1,25 @@
|
|||
FROM python:3.7.3-alpine3.9
|
||||
FROM python:3.7-slim
|
||||
|
||||
RUN apt-get update && \
|
||||
apt-get install -y gcc && \
|
||||
pip3 install uwsgi && \
|
||||
apt-get remove --purge -y gcc && \
|
||||
apt-get autoremove -y
|
||||
|
||||
EXPOSE 8000/tcp
|
||||
ENV HUMULUS_SETTINGS=/app/instance/settings.py
|
||||
ENV UWSGI_PROCESSES=4
|
||||
ENV UID=9000
|
||||
ENV GID=9000
|
||||
|
||||
ADD . /app/
|
||||
|
||||
WORKDIR /app
|
||||
RUN pip3 install --no-cache-dir .
|
||||
|
||||
RUN pip install .
|
||||
RUN pip install waitress
|
||||
|
||||
RUN mkdir -p /app/instance
|
||||
ENV HUMULUS_SETTINGS=/app/instance/settings.py
|
||||
|
||||
CMD ["waitress-serve", "--call", "humulus:create_app"]
|
||||
CMD uwsgi --master \
|
||||
--uid $UID \
|
||||
--gid $GID \
|
||||
--plugins python3 \
|
||||
--http-socket :8000 \
|
||||
-p ${UWSGI_PROCESSES} \
|
||||
--module 'humulus:create_app()'
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue