-
Notifications
You must be signed in to change notification settings - Fork 12
/
Dockerfile
51 lines (45 loc) · 1.01 KB
/
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
# Stage 1 - Compile needed python dependencies
FROM alpine:3.7 AS build
RUN apk --no-cache add \
gcc \
musl-dev \
pcre-dev \
linux-headers \
postgresql-dev \
python3 \
python3-dev \
# lxml
libxslt-dev \
# Pillow dependencies
jpeg-dev \
openjpeg-dev \
zlib-dev \
# Remote deps
git
RUN pip3 install virtualenv
RUN virtualenv /app/env
WORKDIR /app
COPY ./requirements /app/requirements
RUN /app/env/bin/python -m pip install --upgrade pip
RUN /app/env/bin/pip install -r requirements/dev.txt
RUN /app/env/bin/pip install uwsgi
# Stage 2 - Build docker image suitable for execution and deployment
FROM alpine:3.7
RUN apk --no-cache add \
ca-certificates \
mailcap \
musl \
pcre \
postgresql \
python3 \
zlib \
libxslt
COPY ./src /app/src
COPY ./zds /app/zds
COPY ./docker/start.sh /start.sh
RUN mkdir /app/log
COPY --from=build /app/env /app/env
ENV PATH="/app/env/bin:${PATH}"
WORKDIR /app
EXPOSE 8000
CMD ["/start.sh"]