LAMP 環境の docker-compose です。
ちょっとしたポイントとしては、以下な感じです。
不要なものは適宜消して docker-compose up すればいいだろう。という方針です。
極力普通に、まったく尖った仕様ではないと自分では思ってます。
以上、備忘録として。
├ .env ├ docker-compose.yml ├ db │ └ conf.d │ └ my.cnf ├ phpmyadmin │ └ config.user.inc.php └ web ├ added_php.ini └ Dockerfile
# web WEB_PORT=10080 # phpMyAdmin PHPMYADMIN_PORT=10081 # db DB_PORT=13306 DB_PASSWORD=pass
version: '3' services: web: build: ./web ports: - ${WEB_PORT}:80 volumes: - ./volumes/web/:/var/www/html - ./web/added_php.ini:/etc/php.d/added_php.ini container_name: "lamp-web" db: image: mariadb/server:10.4 environment: MYSQL_ROOT_PASSWORD: ${DB_PASSWORD} MYSQL_ROOT_HOST: "%" TZ: Asia/Tokyo ports: - ${DB_PORT}:3306 volumes: - ./volumes/db/:/var/lib/mysql - ./db/conf.d/:/etc/mysql/conf.d - ./db/initdb/:/docker-entrypoint-initdb.d container_name: "lamp-db" phpmyadmin: image: phpmyadmin/phpmyadmin:latest ports: - ${PHPMYADMIN_PORT}:80 environment: - PMA_ARBITRARY=1 - PMA_HOST=db - PMA_USER=root - PMA_PASSWORD=${DB_PASSWORD} volumes: - /sessions - ./phpmyadmin/config.user.inc.php:/etc/phpmyadmin/config.user.inc.php container_name: "lamp-phpmyadmin"
memory_limit = -1 upload_max_filesize = 16G post_max_size = 16G max_execution_time = 1200 [Date] date.timezone = "Asia/Tokyo" [mbstring] mbstring.internal_encoding = "UTF-8" mbstring.language = "Japanese" ; XDEBUG ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; xdebug.remote_enable=1 ; 192.168.1.2 ... xdebug.remote_host=host.docker.internal xdebug.remote_port=9000 xdebug.remote_handler="dbgp"
FROM centos:centos7 RUN yum -y update # タイムゾーンを日本時間に設定 RUN \cp -p -f /usr/share/zoneinfo/Japan /etc/localtime # install apache2.4 RUN yum -y install httpd # install php73 RUN yum -y install http://rpms.famillecollet.com/enterprise/remi-release-7.rpm RUN yum -y install --enablerepo=epel libedit libargon2 libzip libXpm libtiff libmcrypt fontconfig-devel libfreetype libpng15 liblzf RUN yum -y install --disablerepo=* --enablerepo=remi,remi-php73 php php-mbstring php-pdo php-gd php-mcrypt php-mysqlnd php-pecl-redis php-pecl-xdebug php-opcache php-pecl-apcu # composer インストール RUN php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" \ && php composer-setup.php \ && php -r "unlink('composer-setup.php');" \ && mv composer.phar /usr/local/bin/composer EXPOSE 80 CMD ["httpd", "-D", "FOREGROUND"]
[mysqld] character-set-server=utf8mb4 collation-server=utf8mb4_bin [client] default-character-set=utf8mb4
<?php // Maximum execution time = no limit $cfg['ExecTimeLimit'] = 0; // phpinfo enable $cfg['ShowPhpInfo'] = true;
(This host) = https://thinkridge.com