-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
executable file
·55 lines (43 loc) · 1.62 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
FROM wordpress:latest
RUN docker-php-ext-install pdo pdo_mysql
RUN docker-php-ext-enable pdo pdo_mysql
RUN apt-get update \
&& apt-get install -y wget \
&& rm -rf /var/lib/apt/lists/*
RUN apt-get update -y && \
apt-get upgrade -y && \
apt-get dist-upgrade -y && \
apt-get -y autoremove && \
apt-get clean
RUN apt-get install zip unzip && \
rm -rf /var/lib/apt/lists/*
# install localisation
RUN apt-get update && \
# locales
apt-get install -y locales
# enable localisation and generates localisation files
RUN sed -i -e 's/# cs_CZ.UTF-8/cs_CZ.UTF-8/' /etc/locale.gen && \
sed -i -e 's/# cs_CZ.UTF-8/cs_CZ.UTF-8/' /etc/locale.gen && \
locale-gen
RUN echo "cs_CZ.UTF-8 UTF-8" >> /etc/locale.gen
# Imstall the locale
RUN apt-get update -y && \
apt-get install -y locales locales-all
# Set the locale
RUN sed -i '/cs_CZ.UTF-8/s/^# //g' /etc/locale.gen && locale-gen
ENV LANG cs_CZ.UTF-8
ENV LANGUAGE cs_CZ.UTF-8
ENV LC_ALL cs_CZ.UTF-8
# fetch plugins
COPY plugins.list /tmp/plugins.list
RUN cd /var/www/html/wp-content/plugins && rm -rfv * && \
# Strip comments from plugins.list file (https://unix.stackexchange.com/a/157619/352972) and then install each plugin:
for plugin in $(sed '/^[[:blank:]]*#/d;s/#.*//' /tmp/plugins.list); do \
# The for loop swallows any non-zero exit code, we need to exit explicitly on failure:
echo "Installing plugin $plugin" && \
wget -q $plugin -O temp.zip && \
unzip -q temp.zip && \
rm temp.zip || exit 1; \
done
# set correct rights for plugins
RUN chown -R www-data:www-data /var/www/html/wp-content/plugins