-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
42 lines (34 loc) · 1.45 KB
/
Dockerfile
File metadata and controls
42 lines (34 loc) · 1.45 KB
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
FROM wordpress:latest
# Dependency Installation
RUN apt-get update && \
apt-get upgrade -y && \
apt-get install -y python3 vim less && \
# WP-CLI Installation
curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar && \
chmod +x wp-cli.phar && \
mv wp-cli.phar /usr/local/bin/wp && \
# Enable Apache headers module
a2enmod headers && \
# MySQL
apt-get install -y default-mysql-client && \
# Cleanup
apt-get clean && \
rm -rf /var/lib/apt/lists/*
# Copying Themes and Plugins into the WordPress image
# Uncomment and adjust these lines if you have custom themes or plugins
# COPY themes /usr/src/wordpress/wp-content/themes
# COPY plugins /usr/src/wordpress/wp-content/plugins
# Copying custom entrypoint script
COPY entrypoint-child.sh /usr/local/bin/
RUN chmod +x /usr/local/bin/entrypoint-child.sh
# Updating the configuration of WordPress image
# Uncomment and adjust these lines if you have custom configurations
# COPY ./config/uploads.ini /usr/local/etc/php/conf.d/uploads.ini
# COPY ./config/docker-apache.conf /etc/apache2/conf-enabled/docker-apache.conf
RUN sed -i 's/Listen 80/Listen 8080/g' /etc/apache2/ports.conf && \
sed -i 's/<VirtualHost \*:80>/<VirtualHost *:8080>/g' /etc/apache2/sites-available/000-default.conf
# Copying custom health check file
COPY health-check.php /var/www/html/health-check.php
EXPOSE 8080
ENTRYPOINT ["entrypoint-child.sh"]
CMD ["apache2-foreground"]