Skip to content

Commit

Permalink
Reintroduce uWSGI
Browse files Browse the repository at this point in the history
  • Loading branch information
gsfr committed Nov 23, 2017
1 parent def94cf commit 5efc4b0
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 14 deletions.
19 changes: 9 additions & 10 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,21 +1,20 @@
FROM python:2.7-alpine3.6 as build
ARG UWSGI_VERSION="2.0.15"

RUN apk add --no-cache build-base curl
FROM python:2.7-alpine3.6 as build

WORKDIR /src/nginx-unit
RUN apk add --no-cache build-base linux-headers pcre-dev

RUN curl -L https://github.com/nginx/unit/archive/master.tar.gz | tar xz --strip-components 1
RUN ./configure --prefix=/usr/local --modules=lib --state=/var/local/unit --pid=/var/unit.pid --log=/var/log/unit.log \
&& ./configure python \
&& make install
ARG UWSGI_VERSION
RUN pip wheel "uwsgi==$UWSGI_VERSION"


FROM python:2.7-alpine3.6 as dist

RUN apk add --no-cache git

COPY --from=build /usr/local/sbin/unitd /usr/local/sbin/unitd
COPY --from=build /usr/local/lib/python.unit.so /usr/local/lib/python.unit.so
ARG UWSGI_VERSION
COPY --from=build /uWSGI-$UWSGI_VERSION-cp27-cp27mu-linux_x86_64.whl /uWSGI-$UWSGI_VERSION-cp27-cp27mu-linux_x86_64.whl
RUN pip install /uWSGI-$UWSGI_VERSION-cp27-cp27mu-linux_x86_64.whl

EXPOSE 80 8080 27017

Expand All @@ -30,7 +29,7 @@ RUN pip install -r requirements.txt
COPY . .
RUN pip install -e .

CMD ["unitd", "--control", "*:8080", "--no-daemon", "--log", "/dev/stdout"]
CMD ["uwsgi", "--ini", "docker/uwsgi-config.ini"]


FROM dist as testing
Expand Down
3 changes: 1 addition & 2 deletions docker/dev+mongo.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#!/usr/bin/env sh

mongod &
MONGOD_PID=$!

exec unitd --control "*:8888" --no-daemon --log /dev/stdout
uwsgi --ini docker/uwsgi-config.ini
3 changes: 1 addition & 2 deletions docker/uwsgi-config.ini
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
[uwsgi]
http = 0.0.0.0:80
wsgi-file = bin/api.wsgi
chdir=code/api
pythonpath=code/data
master = True
die-on-term = True
processes = 4
Expand Down

0 comments on commit 5efc4b0

Please sign in to comment.