Skip to content

Commit 5efc4b0

Browse files
committed
Reintroduce uWSGI
1 parent def94cf commit 5efc4b0

File tree

3 files changed

+11
-14
lines changed

3 files changed

+11
-14
lines changed

Dockerfile

+9-10
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,20 @@
1-
FROM python:2.7-alpine3.6 as build
1+
ARG UWSGI_VERSION="2.0.15"
22

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

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

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

1210

1311
FROM python:2.7-alpine3.6 as dist
1412

1513
RUN apk add --no-cache git
1614

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

2019
EXPOSE 80 8080 27017
2120

@@ -30,7 +29,7 @@ RUN pip install -r requirements.txt
3029
COPY . .
3130
RUN pip install -e .
3231

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

3534

3635
FROM dist as testing

docker/dev+mongo.sh

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
#!/usr/bin/env sh
22

33
mongod &
4-
MONGOD_PID=$!
54

6-
exec unitd --control "*:8888" --no-daemon --log /dev/stdout
5+
uwsgi --ini docker/uwsgi-config.ini

docker/uwsgi-config.ini

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
[uwsgi]
2+
http = 0.0.0.0:80
23
wsgi-file = bin/api.wsgi
3-
chdir=code/api
4-
pythonpath=code/data
54
master = True
65
die-on-term = True
76
processes = 4

0 commit comments

Comments
 (0)