forked from KaiHofstetter/docker-wordpress-xdebug
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile_7_3_7
67 lines (47 loc) · 2.26 KB
/
Dockerfile_7_3_7
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
# FROM php:7.1-apache
FROM php:7.3.7-apache
# FROM php:5.6.29-apache
RUN docker-php-ext-install mysqli
RUN pecl install xdebug-2.7.2
# RUN pecl install xdebug
RUN docker-php-ext-enable xdebug
# RUN apt-get update -y && apt-get install -y sendmail libpng-dev
RUN apt-get update -y && apt-get install -y sendmail libpng-dev libjpeg-dev libzip-dev
# RUN apt-get update && \
# apt-get install -y \
# zlib1g-dev
# RUN docker-php-ext-install mbstring
RUN docker-php-ext-install zip
# RUN docker-php-ext-install gd
RUN docker-php-ext-configure gd --with-jpeg-dir=/usr/include/ --with-png-dir=/usr/include/ && \
docker-php-ext-install -j$(getconf _NPROCESSORS_ONLN) gd
RUN echo "upload_max_filesize = 128M" >> /usr/local/etc/php/php.ini
RUN echo "post_max_size = 128M" >> /usr/local/etc/php/php.ini
RUN echo "xdebug.remote_enable=1" >> /usr/local/etc/php/php.ini
RUN echo "xdebug.remote_connect_back=1" >> /usr/local/etc/php/php.ini
RUN echo "xdebug.remote_autostart=1" >> /usr/local/etc/php/php.ini
RUN apt-get update && apt-get -y install mariadb-server nano
RUN a2enmod rewrite
# RUN service mysql start
RUN service mysql start && mysql -uroot -p -e "GRANT ALL PRIVILEGES ON *.* TO 'username'@'localhost' IDENTIFIED BY 'password';" && mysql -u username -ppassword -e "CREATE DATABASE wordpress;"
# Download WordPress
RUN curl -L "https://wordpress.org/wordpress-latest.tar.gz" > /wordpress.tar.gz
RUN tar -xzf /wordpress.tar.gz -C /var/www/html --strip-components=1 && \
rm /wordpress.tar.gz
# Download WordPress CLI
RUN curl -L "https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar" > /usr/bin/wp && \
chmod +x /usr/bin/wp
# RUN service mysql start && cd /var/www/html && \
# wp config create --dbname=wordpress --dbuser=username --dbpass=password --dbhost=127.0.0.1 --allow-root && \
# RUN cd /var/www/html && wp config set WP_DEBUG true --raw --allow-root
# WordPress configuration
# ADD wp-config.php /var/www/html/wp-config.php
COPY start-apache-and-mysql.sh /start-apache-and-mysql.sh
RUN chmod +x /start-apache-and-mysql.sh
RUN chmod -R 777 /var/www/html
RUN chown -R www-data:www-data /var/www/html
# EXPOSE 80 3306 9000
EXPOSE 22
# ENTRYPOINT ["/start-apache-and-mysql.sh"]
CMD [ "apache2-foreground" ]
ENTRYPOINT ["/start-apache-and-mysql.sh"]