This repository has been archived by the owner on Oct 30, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
69 lines (53 loc) · 1.58 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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
FROM ubuntu:16.04
ARG domainkey
ARG gatewayid
# install dependencies
#RUN apt-get update \
# && apt-get install -y --no-install-recommends \
# apache2 \
# && rm -r /var/lib/apt/lists/*
RUN apt-get update
RUN apt-get install -y apache2
RUN apt install -y software-properties-common
RUN LC_ALL=C.UTF-8 add-apt-repository -y ppa:ondrej/apache2
RUN apt update
RUN apt install -y apache2
# Default command
CMD ["apachectl", "-D", "FOREGROUND"]
# Install Node.js
RUN apt-get update \
&& apt-get install --yes curl
RUN curl --silent --location https://deb.nodesource.com/setup_7.x | bash -
RUN apt-get install --yes nodejs
RUN apt-get install --yes build-essential
#create directory html
RUN mkdir /var/www/html/dist
RUN mkdir -p /opt/app
# ssl certificate add
ADD cert /etc/ssl/cert
ADD privkey /etc/ssl/privkey
#working directory
WORKDIR /opt/app
ADD . /opt/app
RUN npm install
#build application
RUN npm run build
RUN cp -a -f /opt/app/bower_components /var/www/html/
RUN cp -a -f /opt/app/vids /var/www/html/
RUN cp -a -f /opt/app/src/assets /var/www/html/
RUN cp -a -f /opt/app/dist/* /var/www/html/
RUN cp /opt/app/.htaccess /var/www/html/
RUN cp /opt/app/vhost_ssl_master.conf /etc/apache2/sites-enabled/
RUN cp /opt/app/vhost_ssl_develop.conf /etc/apache2/sites-enabled/
RUN cp /opt/app/vhost_ssl_qa.conf /etc/apache2/sites-enabled/
RUN cp /opt/app/vhost_ssl_staging.conf /etc/apache2/sites-enabled/
RUN rm -rf /opt/app/*
RUN a2enmod rewrite
RUN a2enmod ssl
RUN a2enmod http2
#RUN service apache2ctl restart
#RUN service apache2 startssl
RUN service apache2 restart
# Ports
EXPOSE 80
EXPOSE 443