forked from VNG-Realisatie/api-test-platform-code
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
72 lines (62 loc) · 1.43 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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
# Stage 1.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 \
# libraries installed using git
git \
# lxml dependencies
libxslt-dev \
# pillow dependencies
jpeg-dev \
openjpeg-dev \
zlib-dev
RUN pip3 install virtualenv
RUN virtualenv /app/env
WORKDIR /app
COPY ./requirements /app/requirements
RUN /app/env/bin/pip install -r requirements/dev.txt
RUN /app/env/bin/pip install uwsgi
# Stage 1.2 - Compile needed frontend dependencies
RUN apk --no-cache add \
# node.js
nodejs \
nodejs-npm \
python
COPY ./build /app/build
COPY ./src /app/src
COPY ./*.js /app/
COPY ./*.json /app/
RUN npm install
# See: https://stackoverflow.com/questions/22115400/why-do-we-need-to-install-gulp-globally-and-locally
RUN npm install -g gulp
RUN npm install gulp
RUN gulp build
# 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 \
# lxml dependencies
libxslt \
# pillow dependencies
jpeg \
openjpeg \
zlib
COPY --from=build /app/src /app/src
COPY ./bin/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"]