Closed kevinosburn closed 4 years ago
Hi @kevinosburn.
You're welcome :wink:!
Replace postgres
and postgres-testing
sections in the docker-compose.yml
file with the following code:
### MySQL Database ##########################
mysql:
image: mysql:5.7
volumes:
- database:/var/lib/mysql
environment:
- MYSQL_ROOT_PASSWORD=secret
- MYSQL_USER=app
- MYSQL_PASSWORD=app
- MYSQL_DATABASE=app
ports:
- 33061:3306
Remove current docker volumes with postgres data running the following command:
docker-compose down --volumes
Remove docker/postgres directory.
Replace all postgres
occurrences in the docker-compose.yml
with mysql
.
Update your .env database configuration:
DB_CONNECTION=mysql
DB_HOST=mysql
DB_PORT=3306
Add the following code to docker/php-cli/Dockerfile
, docker/php-fpm/Dockerfile
and docker/supervisor/Dockerfile
files replacing # Postgres
line:
# MySQL
RUN docker-php-ext-install pdo pdo_mysql
Run docker-compose build
command, then docker-compose restart
.
That should work.
And one question from me, please. Which OS do you use?
Hi @nevadskiy
Thanks for the fast response!
I'm running this on Ubuntu 18.04 and also on a Windows 10 machine.
Oh, just a small typo here... istall
should be install
Install composer dependencies:
docker-compose exec php-cli composer istall
-Kevin
@kevinosburn thanks.
Hi @nevadskiy
This is very useful... Thanks for putting this together!
Not an "issue", but more of a feature request. What would be the best approach to replace postgres with mysql?
Thanks!