-
Notifications
You must be signed in to change notification settings - Fork 191
/
single.stage.Dockerfile
35 lines (28 loc) · 1.06 KB
/
single.stage.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
FROM ushahidi/node-ci:node-10-gulp-4
ARG HTTP_PORT=8080
RUN apt-get update && \
apt-get install --no-install-recommends -y nginx python python-pip python-setuptools python-yaml && \
pip install 'jinja2-cli[yaml]==0.6.0' && \
apt-get clean && \
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
RUN mkdir -p /var/app
WORKDIR /var/app
COPY package.json .
RUN npm-install-silent.sh
COPY . ./
RUN gulp build
WORKDIR /usr/share/nginx/html
RUN rsync -a --delete-after /var/app/server/www/ ./
COPY app/config.js.j2 ./config.js.j2
COPY app/config.json.j2 ./config.json.j2
COPY docker/nginx.default.conf /etc/nginx/sites-enabled/default
COPY docker/nginx.run.sh /nginx.run.sh
RUN sed -i 's/$HTTP_PORT/'$HTTP_PORT'/' /etc/nginx/sites-enabled/default && \
chgrp -R 0 . /var/lib/nginx /run && \
chmod -R g+rwX . /var/lib/nginx /run && \
ln -sf /dev/stdout /var/log/nginx/access.log && \
ln -sf /dev/stderr /var/log/nginx/error.log
ENV HTTP_PORT=$HTTP_PORT
EXPOSE $HTTP_PORT
ENTRYPOINT [ "/bin/sh", "/nginx.run.sh" ]
CMD [ "/usr/sbin/nginx", "-g", "daemon off;" ]