-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile-php8.2-mysql8-elasticsearch7-nginx
73 lines (61 loc) · 1.84 KB
/
Dockerfile-php8.2-mysql8-elasticsearch7-nginx
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
FROM docker.elastic.co/elasticsearch/elasticsearch:7.17.14
USER root
WORKDIR /var/www/html
ARG DEBIAN_FRONTEND=noninteractive
RUN apt-get update \
&& apt-get install -y software-properties-common \
&& add-apt-repository ppa:ondrej/php
ENV PHP_FPM \
php8.2-fpm \
php8.2-curl \
php8.2-xsl \
php8.2-intl \
php8.2-mysql \
php8.2-soap \
php8.2-zip \
php8.2-opcache \
php8.2-bcmath \
php8.2-gd \
php8.2-mbstring \
php8.2-xdebug
RUN apt-get update && apt-get install -y \
$PHP_FPM \
vim \
unzip \
zip \
cron \
nano \
procps \
ssmtp mailutils \
default-mysql-client \
nginx \
wget \
net-tools \
--no-install-recommends \
&& yes | apt-get install -y mysql-server-8.0
# Install Composer
RUN curl -sS https://getcomposer.org/installer | php \
&& mv composer.phar /usr/local/bin/composer
# Add bash
ADD bash/.vimrc /root/.vimrc
ADD bash/.bash_aliases /usr/local/share/.bash_aliases
ADD bash/start_elasticsearch /usr/local/bin/start_elasticsearch
RUN chmod 0777 /usr/local/bin/start_elasticsearch
# Config mysql
ADD mysql/create-db.sql /var/www/create-db.sql
ADD mysql/my.cnf /etc/my.cnf
RUN service mysql start \
&& sleep 5 \
&& mysql -u root -proot < /var/www/create-db.sql \
&& rm -rf /var/www/create-db.sql
# Config nginx
ADD nginx/host.conf /etc/nginx/host.conf
ADD nginx/magento.conf /etc/nginx/conf.d/default.conf
ADD nginx/nginx.conf /etc/nginx/nginx.conf
# Config php-fpm
ADD php-fpm/zz-docker.conf /etc/php/8.2/fpm/pool.d/www.conf
ADD php-fpm/99-xdebug.ini /usr/local/etc/php/conf.d/
ADD php-fpm/php-custom.ini /etc/php/8.2/cli/conf.d/
# Terminal interface
RUN printf 'PS1="\[\e[32m\]\u\[\e[m\]\[\e[34m\]@\[\e[m\]\[\e[36m\]\w\[\e[m\] \[\e[35m\]\T\[\e[m\] ➞ "\n\
. /usr/local/share/.bash_aliases\n' | tee --append /etc/bash.bashrc /root/.bashrc