Skip to content

Commit

Permalink
chore(py3): update dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
Jiaqi Liu committed Dec 3, 2019
1 parent 67b197a commit 4e19db7
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 11 deletions.
30 changes: 20 additions & 10 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,24 +1,34 @@
# To run: docker run -v /path/to/wsgi.py:/var/www/peregrine/wsgi.py --name=peregrine -p 81:80 peregrine
# To check running container: docker exec -it peregrine /bin/bash
# To check running container: docker exec -it peregrine /bin/bash

FROM quay.io/cdis/py27base:pybase2-1.0.2
FROM quay.io/cdis/python-nginx:pybase3-1.1.0

ENV DEBIAN_FRONTEND=noninteractive

RUN mkdir /var/www/peregrine \
&& chown www-data /var/www/peregrine
RUN apk update \
&& apk add postgresql-libs postgresql-dev libffi-dev libressl-dev \
&& apk add linux-headers musl-dev gcc libxml2-dev libxslt-dev \
&& apk add curl bash git vim

COPY . /peregrine
COPY ./deployment/uwsgi/uwsgi.ini /etc/uwsgi/uwsgi.ini
WORKDIR /peregrine

RUN pip install -r requirements.txt \
&& COMMIT=`git rev-parse HEAD` && echo "COMMIT=\"${COMMIT}\"" >peregrine/version_data.py \
&& VERSION=`git describe --always --tags` && echo "VERSION=\"${VERSION}\"" >>peregrine/version_data.py
RUN python -m pip install --upgrade pip \
&& python -m pip install --upgrade setuptools \
&& pip --version \
&& pip install -r requirements.txt

RUN mkdir -p /var/www/peregrine \
&& mkdir /run/ngnix/ \
&& chown www-data /var/www/peregrine

EXPOSE 80

WORKDIR /var/www/peregrine
RUN COMMIT=`git rev-parse HEAD` && echo "COMMIT=\"${COMMIT}\"" >peregrine/version_data.py \
&& VERSION=`git describe --always --tags` && echo "VERSION=\"${VERSION}\"" >>peregrine/version_data.py \
&& python setup.py install


WORKDIR /var/www/peregrine

ENTRYPOINT [ "/bin/sh", "/dockerrun.sh" ]
CMD []
2 changes: 1 addition & 1 deletion TestDockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
libxml2-dev \
libxslt1-dev \
nginx \
python2.7 \
python3.6 \
python-dev \
python-pip \
python-setuptools \
Expand Down

0 comments on commit 4e19db7

Please sign in to comment.