-
Notifications
You must be signed in to change notification settings - Fork 49
/
Dockerfile
42 lines (33 loc) · 1.01 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
FROM node:8
LABEL maintainer "Nitin Goyal <[email protected]>, Luke Busstra <[email protected]>"
ENV NGINX_CODENAME stretch
# 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
# copy project - LOCAL CODE
RUN mkdir -p /var/www/cezerin2-admin
COPY . /var/www/cezerin2-admin
WORKDIR /var/www/cezerin2-admin
# 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-admin \
&& npm install \
&& npm cache clean --force \
&& npm run build
EXPOSE 80
# start env build and Nginx
ENTRYPOINT ["/usr/local/bin/docker-entrypoint.sh"]