Skip to content

Commit dc5729e

Browse files
author
Dan Kelley
committed
updated to build to use WSGI, needs some more cleanup
1 parent cd8968b commit dc5729e

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

src/server/Dockerfile

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,24 @@
1-
FROM python:3.7
1+
FROM python:3.8
22

33
WORKDIR /app
44

55
ENV PYTHONDONTWRITEBYTECODE 1
66
ENV PYTHONUNBUFFERED 1
77

88
RUN apt-get update
9+
10+
RUN apt-get install -y python3-dev uwsgi uwsgi-src libcap-dev uwsgi-plugin-python3
911
RUN pip install --upgrade pip
1012

1113
COPY requirements.txt /
1214

1315
RUN pip install --no-cache-dir -r /requirements.txt
1416

17+
RUN export PYTHON=python3.8
18+
RUN uwsgi --build-plugin "/usr/src/uwsgi/plugins/python python38"
19+
RUN mv python38_plugin.so /usr/lib/uwsgi/plugins/python38_plugin.so
20+
RUN chmod 666 /usr/lib/uwsgi/plugins/python38_plugin.so
21+
1522
COPY . .
1623

1724
RUN mkdir /app/static \
@@ -29,9 +36,9 @@ RUN chmod -R 777 /app/static
2936
COPY . /paws-data-pipeline/server
3037

3138
RUN chmod 777 /paws-data-pipeline/server
32-
39+
# RUN ufw allow 5000
3340
WORKDIR /app
3441

35-
CMD python app.py
36-
37-
42+
# CMD python app.py
43+
# --uid uwsgi
44+
CMD uwsgi --http-socket :5000 --plugin python38 --module wsgi:app

0 commit comments

Comments
 (0)