forked from BonnierNews/s2i-wordpress
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Dockerfile.7.0
55 lines (49 loc) · 2.37 KB
/
Dockerfile.7.0
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
FROM centos/php-70-centos7:latest
ARG WORDPRESS_VERSION
ARG WORDPRESS_SHA1
ENV WORDPRESS_VERSION=${WORDPRESS_VERSION:-4.5} \
WORDPRESS_SHA1=${WORDPRESS_SHA1:-439f09e7a948f02f00e952211a22b8bb0502e2e2} \
NODEJS_VERSION=10 \
NPM_RUN=start \
NPM_CONFIG_PREFIX=$HOME/.npm-global \
PATH=$HOME/node_modules/.bin/:$HOME/.npm-global/bin/:$PATH
VOLUME /opt/app-root/wp-content
# Add nodejs and php apcu cache
USER root
RUN yum install -y centos-release-scl-rh && \
yum remove -y rh-nodejs\* && \
yum-config-manager --enable centos-sclo-rh-testing && \
INSTALL_PKGS="rh-nodejs10 rh-nodejs10-npm rh-nodejs10-nodejs-nodemon nss_wrapper sclo-php70-php-pecl-apcu sclo-php70-php-pecl-redis sclo-php70-php-pecl-memcached rh-mysql57-mysql" && \
ln -s /usr/lib/node_modules/nodemon/bin/nodemon.js /usr/bin/nodemon && \
yum install -y --setopt=tsflags=nodocs $INSTALL_PKGS && \
rpm -V $INSTALL_PKGS && \
yum clean all -y
# Install wordpress and backup the base image S2I scripts
RUN echo "Install wordpress and backup the base image S2I scripts" \
&& cd /tmp && curl -o wordpress.tar.gz -SL https://wordpress.org/wordpress-${WORDPRESS_VERSION}.tar.gz \
&& mkdir -p /opt/app-root/wordpress \
&& echo "$WORDPRESS_SHA1 *wordpress.tar.gz" | sha1sum -c - \
&& tar -xzf wordpress.tar.gz --strip-components=1 -C /opt/app-root/wordpress \
&& rm -rf /opt/app-root/wordpress/wp-content/plugins/akismet \
&& rm -f /opt/app-root/wordpress/wp-content/plugins/hello.php \
&& rm wordpress.tar.gz \
&& mv /opt/app-root/wordpress/wp-content /opt/app-root/wordpress/wp-content-install \
&& mv $STI_SCRIPTS_PATH/run $STI_SCRIPTS_PATH/run-base \
&& mv $STI_SCRIPTS_PATH/assemble $STI_SCRIPTS_PATH/assemble-base \
&& fix-permissions /opt/app-root/wordpress \
&& fix-permissions /opt/app-root/wp-content && chmod -R 0777 /opt/app-root/wp-content \
&& curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar \
&& php wp-cli.phar --info \
&& mv wp-cli.phar /usr/local/bin/wp \
&& chmod +x /usr/local/bin/wp \
&& rm -f ${PHP_SYSCONF_PATH}/php.d/40-apcu.ini
# Install config templates and certs
COPY contrib/templates/* /opt/app-root/templates/
COPY contrib/certs/* /etc/pki/ca-trust/source/anchors/
# Add certs
RUN update-ca-trust
# Add root
COPY ./root/ /
# Install wordpress S2I scripts
COPY s2i/bin/* $STI_SCRIPTS_PATH/
USER 1001