-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
33 lines (25 loc) · 925 Bytes
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
FROM alpine:3.8
RUN apk update
# Install python3 and pip3
RUN apk add --no-cache python3 && \
python3 -m ensurepip && \
rm -r /usr/lib/python*/ensurepip && \
pip3 install --upgrade pip setuptools && \
if [ ! -e /usr/bin/pip ]; then ln -s pip3 /usr/bin/pip ; fi && \
if [[ ! -e /usr/bin/python ]]; then ln -sf /usr/bin/python3 /usr/bin/python; fi
# Install postgresql (doesn't work in requirements)
RUN apk update \
&& apk add --virtual build-deps gcc python3-dev musl-dev \
&& apk add --no-cache postgresql-dev \
&& pip install psycopg2 \
&& apk del build-deps
RUN rm -r /root/.cache
# Install bash
RUN apk add --no-cache bash \
&& apk add --no-cache bash-completion
# Install Git (to be able to install libs from git)
RUN apk add git
RUN mkdir -p /home/django/webapp
WORKDIR /home/django/webapp
COPY . .
RUN pip install --index-url=https://pypi.python.org/simple/ -r requirements.pip