Skip to content

Commit

Permalink
[develop] fix version update error for mysql
Browse files Browse the repository at this point in the history
  • Loading branch information
aps1027 committed Mar 28, 2023
1 parent e5b4b90 commit 32378e7
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 10 deletions.
21 changes: 16 additions & 5 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
version: "3.7"

networks:
laravel:

services:
nginx:
image: nginx:latest
Expand All @@ -10,6 +13,8 @@ services:
- ./laravel:/var/www/html # To change project folder name
depends_on:
- php-fpm
networks:
- laravel

php-fpm:
build:
Expand All @@ -22,19 +27,23 @@ services:
depends_on:
- mysql
- phpmyadmin
networks:
- laravel

mysql:
image: mysql:latest
image: mysql:8.0
container_name: laravel-db
ports:
- 3306:3306 # To change mysql port number
environment:
MYSQL_ROOT_PASSWORD: rootPass
MYSQL_USER: user # To change database user
MYSQL_PASSWORD: password # To change database user password
MYSQL_DATABASE: laravel # To change database name
MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: app # To change database name
volumes:
- ./mysql/custom.cnf:/etc/mysql/conf.d/custom.cnf
- db-data:/var/lib/mysql
command: --default-authentication-plugin=mysql_native_password
networks:
- laravel

phpmyadmin: # This is for mysql GUI view in windows
image: phpmyadmin/phpmyadmin
Expand All @@ -47,6 +56,8 @@ services:
restart: always
ports:
- 8183:80
networks:
- laravel

volumes:
db-data:
8 changes: 4 additions & 4 deletions laravel/.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ APP_URL=http://localhost
LOG_CHANNEL=stack

DB_CONNECTION=mysql
DB_HOST=mysql
DB_HOST=laravel-db
DB_PORT=3306
DB_DATABASE=laravel
DB_USERNAME=user
DB_PASSWORD=password
DB_DATABASE=app
DB_USERNAME=root
DB_PASSWORD=root

BROADCAST_DRIVER=log
CACHE_DRIVER=file
Expand Down
2 changes: 1 addition & 1 deletion php-fpm/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,6 @@ FROM base AS dev

## add development packages.
RUN apk add autoconf gcc g++ make \
&& pecl install xdebug \
&& pecl install xdebug-2.9.8 \
&& docker-php-ext-enable xdebug \
&& apk add nodejs npm yarn

0 comments on commit 32378e7

Please sign in to comment.