-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
74 lines (63 loc) · 2.3 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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
##########################################
#
# Dockerfile
#
# See: https://docker.com/
# See: https://docs.docker.com/engine/reference/builder/
#
# Author: prod3v3loper
# Copyright: prod3v3loper
# License: MIT
# Since: v1.0.0
# Link: https://github.com/prod3v3loper/docker
#
##########################################
FROM php:8.1-apache
# Install system dependencies and PHP extensions
RUN apt-get update && apt-get install -y \
bash-completion \
ghostscript \
less \
nano \
vim \
sendmail \
libfreetype6-dev \
libjpeg62-turbo-dev \
libpng-dev \
libzip-dev \
zlib1g-dev \
libxml2-dev \
&& docker-php-ext-configure gd --with-freetype --with-jpeg \
&& docker-php-ext-install -j$(nproc) \
bcmath \
exif \
gd \
opcache \
soap \
zip \
mysqli \
pdo \
pdo_mysql \
zip \
&& docker-php-ext-enable \
mysqli \
&& rm -rf /var/lib/apt/lists/*
# Grab and install wp-cli from remote
# RUN curl -o /usr/local/bin/wp https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar -o /etc/bash_completion.d/wp-cli https://raw.githubusercontent.com/wp-cli/wp-cli/master/utils/wp-completion.bash
# Set mail() function settings
# RUN echo "sendmail_path=/usr/sbin/sendmail -t -i" >> /usr/local/etc/php/conf.d/sendmail.ini
# RUN sed -i '/#!\/bin\/sh/aservice sendmail restart' /usr/local/bin/docker-php-entrypoint
# RUN sed -i '/#!\/bin\/sh/aecho "$(hostname -i)\t$(hostname) $(hostname).localhost" >> /etc/hosts' /usr/local/bin/docker-php-entrypoint
# Mailhog
RUN curl --location --output /usr/local/bin/mhsendmail https://github.com/mailhog/mhsendmail/releases/download/v0.2.0/mhsendmail_linux_amd64 && chmod +x /usr/local/bin/mhsendmail
RUN echo 'sendmail_path="/usr/local/bin/mhsendmail --smtp-addr=mailhog:1025 --from=noreply@examle.com"' > /usr/local/etc/php/conf.d/mailhog.ini
# Set working directory
WORKDIR /var/www/html/
# Copy files to container htdocs
COPY /var/www /var/www/html/
# NPM actions
# RUN npm install --production
# COMPOSER actions
COPY --from=composer/composer:latest-bin /composer /usr/bin/composer
RUN a2enmod rewrite
CMD ["/usr/sbin/apache2ctl", "-D", "FOREGROUND"]