このページの2つのバージョン間の差分を表示します。
両方とも前のリビジョン 前のリビジョン 次のリビジョン | 前のリビジョン 次のリビジョン 両方とも次のリビジョン | ||
ソフトウェア:docker:docker-compose.yml_dockerfile_作成例:centos8_mysql8.0 [2019/10/30 11:35] humolife |
ソフトウェア:docker:docker-compose.yml_dockerfile_作成例:centos8_mysql8.0 [2020/11/09 18:39] humolife [docker/db/conf.d/my.cnf] |
||
---|---|---|---|
行 6: | 行 6: | ||
├ docker | ├ docker | ||
│ ├ app | │ ├ app | ||
- | │ │ ├ htdocs | ||
- | │ │ │ └ .htaccess | ||
│ │ └ Dockerfile | │ │ └ Dockerfile | ||
│ ├ db | │ ├ db | ||
│ │ ├ conf.d | │ │ ├ conf.d | ||
- | │ │ │ └ my.cnf | + | │ │ │ └ charset.cnf |
│ │ └ Dockerfile | │ │ └ Dockerfile | ||
│ └ docker-compose.yml | │ └ docker-compose.yml | ||
行 39: | 行 37: | ||
ports: | ports: | ||
- 8080:80 | - 8080:80 | ||
- | links: | ||
- | - db: | ||
volumes: | volumes: | ||
- ../ | - ../ | ||
行 53: | 行 49: | ||
===== docker/ | ===== docker/ | ||
< | < | ||
- | FROM centos:latest | + | FROM centos:8 |
- | RUN dnf -y update && dnf -y install httpd | + | RUN dnf -y update && |
+ | | ||
+ | dnf -y install epel-release && \ | ||
+ | dnf -y install https:// | ||
+ | rpm -ivh http:// | ||
+ | dnf module install -y php: | ||
+ | dnf -y install php-pdo php-json php-xml php-mysqlnd php-gd php-mbstring && \ | ||
+ | dnf -y localinstall https:// | ||
+ | dnf -y install mysql-server && \ | ||
+ | dnf -y install crontabs | ||
- | RUN dnf -y install epel-release | + | RUN rm -rf / |
- | + | ln -s / | |
- | RUN dnf -y install https:// | + | |
- | + | ||
- | RUN rpm -ivh http:// | + | |
- | + | ||
- | RUN dnf module install -y php: | + | |
- | RUN dnf install -y php-pdo php-json php-xml php-mysqlnd php-gd php-mbstring | + | |
- | + | ||
- | COPY ./ | + | |
- | + | ||
- | RUN ln -s / | + | |
- | + | ||
- | # MySQL | + | |
- | RUN dnf -y localinstall https:// | + | |
- | + | ||
- | RUN dnf -y install mysql-server | + | |
- | + | ||
- | # cron | + | |
- | RUN dnf -y install crontabs | + | |
# httpd | # httpd | ||
行 82: | 行 69: | ||
</ | </ | ||
- | ===== docker/ | ||
- | < | ||
- | RewriteEngine On | ||
- | RewriteRule ^(.*)$ pj/$1 [QSA,L] | ||
- | </ | ||
===== docker/ | ===== docker/ | ||
< | < | ||
- | FROM mysql:latest | + | FROM mysql:8.0 |
- | COPY ./conf.d /etc/mysql/conf.d | + | |
+ | RUN apt-get update && \ | ||
+ | apt-get -y install locales-all | ||
+ | |||
+ | ENV LANG ja_JP.UTF-8 \ | ||
+ | LANGUAGE ja_JP:ja | ||
+ | |||
+ | COPY ./conf.d/ | ||
</ | </ | ||
- | ===== docker/ | + | ===== docker/ |
< | < | ||
[mysqld] | [mysqld] | ||
- | # Character code setting / collation order setting | + | character-set-server |
- | character_set_server=utf8mb4 | + | collation-server = utf8mb4_bin |
- | collation-server=utf8mb4_bin | + | init-connect='set names utf8' |
- | + | ||
- | default_authentication_plugin= mysql_native_password | + | |
- | [mysql] | + | [client] |
- | default-character-set=utf8mb4 | + | loose-default-character-set = utf8mb4 |
</ | </ | ||
行 125: | 行 112: | ||
# 192.168.99.100 なら、以下でアクセス可能になる | # 192.168.99.100 なら、以下でアクセス可能になる | ||
- | http:// | + | # http:// |
# 2回め以降は、バックグラウンドでコンテナを起動するだけでよい | # 2回め以降は、バックグラウンドでコンテナを起動するだけでよい |