-
Notifications
You must be signed in to change notification settings - Fork 23
/
Copy pathDockerfile
54 lines (42 loc) · 1.2 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
FROM node:8
MAINTAINER Restmount <[email protected]>
ENV NGINX_CODENAME jessie
ENV CEZERIN_VERSION 0.33.0
# install requirements and NGINX
RUN echo "deb http://nginx.org/packages/debian/ ${NGINX_CODENAME} nginx" >> /etc/apt/sources.list \
&& apt-get update && apt-get install --no-install-recommends --no-install-suggests -y --force-yes \
bash \
zip \
unzip \
wget \
curl \
nano \
ca-certificates \
nginx\
nginx-module-image-filter
# install PM2
RUN npm install pm2 -g
# download project
RUN mkdir -p /var/www \
&& cd /var/www \
&& wget -O cezerin.zip https://github.com/cezerin/cezerin/archive/v$CEZERIN_VERSION.zip \
&& unzip cezerin.zip \
&& rm cezerin.zip \
&& mv cezerin-$CEZERIN_VERSION cezerin
# overwrite config
COPY config/* /var/www/cezerin/config/
# overwrite PM2 process file
COPY process.json /var/www/cezerin/
# Nginx config
COPY nginx/nginx.conf /etc/nginx/
COPY nginx/default.conf /etc/nginx/conf.d/
# script to run Nginx and PM2
COPY docker-entrypoint.sh /usr/local/bin/
# build project
RUN cd /var/www/cezerin \
&& npm install \
&& npm run build
WORKDIR /var/www/cezerin
EXPOSE 80
# start Nginx, PM2
ENTRYPOINT ["/usr/local/bin/docker-entrypoint.sh"]