Skip to content

Commit 50ba164

Browse files
committed
Adds Dockerfile
1 parent 979f4c0 commit 50ba164

File tree

2 files changed

+75
-0
lines changed

2 files changed

+75
-0
lines changed

Dockerfile

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
FROM php:7.3-apache
2+
3+
ENV APACHE_DOCUMENT_ROOT=/var/www/html/web
4+
RUN sed -ri -e 's!/var/www/html!${APACHE_DOCUMENT_ROOT}!g' /etc/apache2/sites-available/*.conf
5+
RUN sed -ri -e 's!/var/www/!${APACHE_DOCUMENT_ROOT}!g' /etc/apache2/apache2.conf /etc/apache2/conf-available/*.conf
6+
7+
# install the PHP extensions we need
8+
RUN set -ex; \
9+
\
10+
savedAptMark="$(apt-mark showmanual)"; \
11+
\
12+
apt-get update; \
13+
apt-get install -y --no-install-recommends \
14+
libjpeg-dev \
15+
libpng-dev \
16+
libzip-dev \
17+
; \
18+
\
19+
docker-php-ext-configure gd --with-png-dir=/usr --with-jpeg-dir=/usr; \
20+
docker-php-ext-install gd mysqli opcache zip; \
21+
\
22+
# reset apt-mark's "manual" list so that "purge --auto-remove" will remove all build dependencies
23+
apt-mark auto '.*' > /dev/null; \
24+
apt-mark manual $savedAptMark; \
25+
ldd "$(php -r 'echo ini_get("extension_dir");')"/*.so \
26+
| awk '/=>/ { print $3 }' \
27+
| sort -u \
28+
| xargs -r dpkg-query -S \
29+
| cut -d: -f1 \
30+
| sort -u \
31+
| xargs -rt apt-mark manual; \
32+
\
33+
apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \
34+
rm -rf /var/lib/apt/lists/*
35+
36+
# set recommended PHP.ini settings
37+
# see https://secure.php.net/manual/en/opcache.installation.php
38+
RUN { \
39+
echo 'opcache.memory_consumption=128'; \
40+
echo 'opcache.interned_strings_buffer=8'; \
41+
echo 'opcache.max_accelerated_files=4000'; \
42+
echo 'opcache.revalidate_freq=2'; \
43+
echo 'opcache.fast_shutdown=1'; \
44+
echo 'opcache.enable_cli=1'; \
45+
} > /usr/local/etc/php/conf.d/opcache-recommended.ini
46+
47+
RUN a2enmod rewrite expires
48+
49+
COPY --from=composer:latest /usr/bin/composer /usr/bin/composer
50+
51+
CMD ["apache2-foreground"]
52+

README.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,25 @@
11
# wp-apache-dev-docker-image
22
WordPress com Apache, para rápido desenvolvimento.
3+
4+
```
5+
wordpress:
6+
image: webfatorial/wp-apache-dev
7+
environment:
8+
- DOTENV=false
9+
- DB_HOST=mysql
10+
- DB_NAME=wordpress
11+
- DB_PASSWORD=root
12+
- DB_USER=root
13+
- DB_USER_HOST=mysql
14+
- DB_PREFIX=wp_prefix_
15+
- DISABLE_WP_CRON=true
16+
- DOMAIN_CURRENT_SITE=dev.site.com
17+
- WP_ENV=development
18+
- WP_HOME=http://dev.site.com
19+
- WP_SITEURL=http://dev.site.com/wp
20+
ports:
21+
- 80:80
22+
volumes:
23+
- .:/var/www/html
24+
command: sh -c "composer install && apache2-foreground"
25+
```

0 commit comments

Comments
 (0)