Skip to content

Instantly share code, notes, and snippets.

@mrbitsdcf
Created June 15, 2017 22:42
Show Gist options
  • Save mrbitsdcf/f735206fa1360b2de1e060fa450d09a7 to your computer and use it in GitHub Desktop.
Save mrbitsdcf/f735206fa1360b2de1e060fa450d09a7 to your computer and use it in GitHub Desktop.
FROM node:boron-alpine
RUN mkdir -p /app
WORKDIR /app
COPY package.json /app/
RUN npm install
COPY . /app
RUN npm run build
RUN apk update && apk upgrade && \
apk add apache2 libxml2-dev apache2-utils && \
mkdir /web/ && chown -R apache.www-data /web && \
sed -i 's#^DocumentRoot ".*#DocumentRoot "/web/html"#g' /etc/apache2/httpd.conf && \
sed -i 's#AllowOverride none#AllowOverride All#' /etc/apache2/httpd.conf && \
sed -i 's#^ServerRoot .*#ServerRoot /web#g' /etc/apache2/httpd.conf && \
sed -i 's/^#ServerName.*/ServerName webproxy/' /etc/apache2/httpd.conf && \
sed -i 's#^IncludeOptional /etc/apache2/conf#IncludeOptional /web/config/conf#g' /etc/apache2/httpd.conf && \
sed -i 's#PidFile "/run/.*#Pidfile "/web/run/httpd.pid"#g' /etc/apache2/conf.d/mpm.conf && \
sed -i 's#Directory "/var/www/localhost/htdocs.*#Directory "/web/html" >#g' /etc/apache2/httpd.conf && \
sed -i 's#Directory "/var/www/localhost/cgi-bin.*#Directory "/web/cgi-bin" >#g' /etc/apache2/httpd.conf && \
sed -i 's#/var/log/apache2/#/web/logs/#g' /etc/logrotate.d/apache2 && \
sed -i 's/Options Indexes/Options /g' /etc/apache2/httpd.conf && \
rm -rf /var/cache/apk/*
RUN cp -r /app/dist/* /web/
EXPOSE 80
CMD ["httpd", "-D", "FOREGROUND;"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment