forked from Cezerin2/Store
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
47 lines (34 loc) · 983 Bytes
/
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
FROM node:8
MAINTAINER Nitin Goyal <nitingoyal.dev@gmail.com>
ENV NGINX_CODENAME stretch
ENV STORE_PORT 3000
# 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 \
gettext-base\
bash \
zip \
unzip \
wget \
curl \
nano \
ca-certificates \
nginx
# install PM2
RUN npm install pm2 -g
RUN mkdir -p /var/www/cezerin2-store
WORKDIR /var/www/cezerin2-store
COPY . /var/www/cezerin2-store
# Nginx config
COPY nginx/nginx.conf /etc/nginx/
COPY nginx/default.conf.template /etc/nginx/conf.d/
# script to run Nginx and PM2
COPY docker-entrypoint.sh /usr/local/bin/
RUN chmod +x "/usr/local/bin/docker-entrypoint.sh"
# build project
RUN cd /var/www/cezerin2-store \
&& npm install \
&& npm run build
EXPOSE 80
# start Nginx, PM2
ENTRYPOINT ["/usr/local/bin/docker-entrypoint.sh"]