Skip to content

Commit

Permalink
PostgreSQLをMySQLに差し替え
Browse files Browse the repository at this point in the history
  • Loading branch information
KentarouTakeda committed Nov 13, 2024
1 parent 94369cf commit 9ce7d39
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 14 deletions.
2 changes: 1 addition & 1 deletion .env.example
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
APP_DEBUG=true
APP_KEY=_DUMMYDUMMYDUMMYDUMMYDUMMYDUMMY_
PORT_BROWSERSYNC=3000
PORT_PGSQL=0
PORT_MYSQL=0
PORT_WEB_APP=8000
PORT_WEB_MAIL=8025
27 changes: 14 additions & 13 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ services:
- php:/var/www
- ./docker/php/php.ini:/usr/local/etc/php/php.ini
- ./docker/php/httpd.conf:/etc/apache2/apache2.conf
- ./docker/php/my.cnf:/home/www-data/.my.cnf
working_dir: /var/www
environment:
APP_DEBUG: ${APP_DEBUG:-true}
Expand All @@ -22,13 +23,12 @@ services:
APP_TIMEZONE: Asia/Tokyo
APP_LOCALE: ja
APP_FAKER_LOCALE: ja_JP
DB_CONNECTION: pgsql
DB_CONNECTION: mysql
DB_HOST: database
DB_PORT: 5432
DB_DATABASE: postgres
DB_USERNAME: postgres
PGHOST: database
PGUSER: postgres
DB_PORT: 3306
DB_DATABASE: app
DB_USERNAME: app
DB_PASSWORD: password
TZ: Asia/Tokyo
MAIL_MAILER: smtp
MAIL_HOST: mail
Expand All @@ -39,22 +39,23 @@ services:
LANGUAGE: en_US

database:
image: postgres:bullseye
image: mysql:8
volumes:
- database:/var/lib/postgresql/data
- ./docker/postgres:/docker-entrypoint-initdb.d
- mysql:/var/lib/mysql
ports:
- ${PORT_PGSQL:-0}:5432
- ${PORT_MYSQL:-0}:3306
environment:
TZ: Asia/Tokyo
PGUSER: postgres
POSTGRES_HOST_AUTH_METHOD: trust
MYSQL_DATABASE: app
MYSQL_USER: app
MYSQL_PASSWORD: password
MYSQL_ROOT_PASSWORD: password

mail:
image: axllent/mailpit
ports:
- ${PORT_WEB_MAIL:-8025}:8025

volumes:
database:
mysql:
php:
7 changes: 7 additions & 0 deletions docker/php/my.cnf
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[mysql]
database=app

[client]
host=database
password=password
user=app

0 comments on commit 9ce7d39

Please sign in to comment.