Skip to content

Commit

Permalink
chore: Remove cruft and simplify Dockerfile (#6633)
Browse files Browse the repository at this point in the history
Also, change to new syntax of pip for install prefix
Ref: #6543 

pypa/pip#7240 (comment)
  • Loading branch information
iamareebjamal authored Nov 28, 2019
1 parent f3bb95c commit d8a71db
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 12 deletions.
15 changes: 4 additions & 11 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
FROM python:3.7.4-alpine as base
LABEL maintainer="Niranjan Rajendran <[email protected]>"
FROM python:3.7-alpine as base

####

Expand All @@ -9,25 +8,19 @@ WORKDIR /install

RUN apk update && \
apk add --virtual build-deps git gcc python3-dev musl-dev jpeg-dev zlib-dev libevent-dev file-dev libffi-dev openssl && \
apk add postgresql-dev && \
pip install setuptools
apk add postgresql-dev

ADD requirements.txt /requirements.txt
ADD requirements /requirements/

RUN wget https://bootstrap.pypa.io/ez_setup.py && python ez_setup.py

ENV PYTHONPATH /install/lib/python3.7/site-packages
RUN pip install --install-option="--prefix=/install" setuptools && \
LIBRARY_PATH=/lib:/usr/lib pip install --install-option="--prefix=/install" -r /requirements.txt
RUN pip install --prefix=/install --no-warn-script-location -r /requirements.txt

####

FROM base

COPY --from=builder /install /usr/local
RUN apk --no-cache add postgresql-dev ca-certificates libxslt jpeg zlib file libxml2 git && \
pip install git+https://github.com/fossasia/[email protected]#egg=flask-rest-jsonapi
RUN apk --no-cache add postgresql-libs ca-certificates libxslt jpeg zlib file libxml2

WORKDIR /data/app
ADD . .
Expand Down
2 changes: 1 addition & 1 deletion requirements/common.txt
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ pytz
diff-match-patch
blinker~=1.4
envparse~=0.2
-e git+https://github.com/fossasia/[email protected]#egg=flask-rest-jsonapi
git+https://github.com/fossasia/[email protected]#egg=flask-rest-jsonapi
wtforms~=2.2
flask-admin~=1.5
google-compute-engine~=2.8
Expand Down

0 comments on commit d8a71db

Please sign in to comment.