This repository has been archived by the owner on Dec 12, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
node14.Dockerfile
61 lines (48 loc) · 2.47 KB
/
node14.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
FROM httpd
WORKDIR /app
#--------------------------------------------------------------------------------------------------
# Install base package
#--------------------------------------------------------------------------------------------------
# APT update and install base package
RUN apt-get update
RUN apt-get install -y curl git openssh-client bash vim
#--------------------------------------------------------------------------------------------------
# Install Node v14 LTS
#--------------------------------------------------------------------------------------------------
# "gcc g++ make" is development tools to enable node build native addons
RUN apt-get install -y gcc g++ make
RUN curl -sL https://deb.nodesource.com/setup_14.x | bash -
RUN apt-get install -y nodejs
#--------------------------------------------------------------------------------------------------
# Skip Host verification for git
#--------------------------------------------------------------------------------------------------
ARG USER_HOME_DIR=/root
RUN mkdir ${USER_HOME_DIR}/.ssh/
RUN echo "StrictHostKeyChecking no " > ${USER_HOME_DIR}/.ssh/config
#--------------------------------------------------------------------------------------------------
# NPM setup
#--------------------------------------------------------------------------------------------------
# Allow root user to execute script command
RUN npm config set unsafe-perm true
#--------------------------------------------------------------------------------------------------
# Setup Apache config
#--------------------------------------------------------------------------------------------------
# Set Apache root directory
ARG APACHE_DOCUMENT_ROOT=/app/build
RUN sed -ri \
-e "s!/usr/local/apache2/htdocs!$APACHE_DOCUMENT_ROOT!g" \
-e "s!AllowOverride None!AllowOverride All!g" \
/usr/local/apache2/conf/httpd.conf
RUN sed -i -e 's/^#\(LoadModule .*mod_rewrite.so\)/\1/' /usr/local/apache2/conf/httpd.conf
# Setup SSL
COPY ./ssl-certificate /ssl-certificate
RUN sed -ri \
-e "s!/usr/local/apache2/htdocs!$APACHE_DOCUMENT_ROOT!g" \
-e "s!/usr/local/apache2/conf/server.crt!/ssl-certificate/server.crt!g" \
-e "s!/usr/local/apache2/conf/server.key!/ssl-certificate/server.key!g" \
/usr/local/apache2/conf/extra/httpd-ssl.conf
RUN sed -i \
-e "s/^#\(Include .*httpd-ssl.conf\)/\1/" \
-e "s/^#\(LoadModule .*mod_ssl.so\)/\1/" \
-e "s/^#\(LoadModule .*mod_socache_shmcb.so\)/\1/" \
/usr/local/apache2/conf/httpd.conf