-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
33 lines (27 loc) · 1.38 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
FROM nginx/unit:latest
# copy python requirements list
COPY pythonapp/requirements.txt /config/requirements.txt
# copy node app
COPY nodeapp /nodeapp
# add Python
RUN apt update && apt install -y python3-pip \
&& pip3 install -r /config/requirements.txt \
&& rm -rf /var/lib/apt/lists/*
# add NGINX Unit and Node.js repos
RUN apt update \
&& apt install -y apt-transport-https gnupg1 procps \
&& curl https://nginx.org/keys/nginx_signing.key | apt-key add - \
&& echo "deb https://packages.nginx.org/unit/debian/ stretch unit" \
> /etc/apt/sources.list.d/unit.list \
&& echo "deb-src https://packages.nginx.org/unit/debian/ stretch unit" \
>> /etc/apt/sources.list.d/unit.list \
&& curl https://deb.nodesource.com/setup_12.x | bash - \
# install build chain
&& apt update \
&& apt install -y build-essential nodejs unit-dev \
# add global dependencies
&& npm install -g --unsafe-perm unit-http
# add app dependencies locally
RUN cd /nodeapp && npm install && npm link unit-http
# run unit with specified control port
CMD ["unitd", "--no-daemon", "--control", "127.0.0.1:9090"]