測試 docker 20250528
This commit is contained in:
parent
871a139587
commit
97a7b05c46
47
docker-compose.yaml
Normal file
47
docker-compose.yaml
Normal file
@ -0,0 +1,47 @@
|
|||||||
|
version: "3.8"
|
||||||
|
|
||||||
|
services:
|
||||||
|
app:
|
||||||
|
image: laravelsail/php82-composer
|
||||||
|
container_name: KTVCentral
|
||||||
|
working_dir: /var/www/html
|
||||||
|
volumes:
|
||||||
|
- ./:/var/www/html
|
||||||
|
depends_on:
|
||||||
|
- mariadb
|
||||||
|
environment:
|
||||||
|
DB_CONNECTION: mariadb
|
||||||
|
DB_HOST: mariadb
|
||||||
|
DB_PORT: 3306
|
||||||
|
DB_DATABASE: Karaoke-Kingpin
|
||||||
|
DB_USERNAME: Karaoke-Kingpin
|
||||||
|
DB_PASSWORD: ESM7yTPMnavFmbBH
|
||||||
|
command: php-fpm
|
||||||
|
|
||||||
|
mariadb:
|
||||||
|
image: mariadb:10.6
|
||||||
|
container_name: KTVCentral_db
|
||||||
|
restart: always
|
||||||
|
environment:
|
||||||
|
MYSQL_ROOT_PASSWORD: root
|
||||||
|
MYSQL_DATABASE: Karaoke-Kingpin
|
||||||
|
MYSQL_USER: Karaoke-Kingpin
|
||||||
|
MYSQL_PASSWORD: ESM7yTPMnavFmbBH
|
||||||
|
volumes:
|
||||||
|
- dbdata:/var/lib/mysql
|
||||||
|
ports:
|
||||||
|
- "3306:3306"
|
||||||
|
|
||||||
|
nginx:
|
||||||
|
image: nginx:stable-alpine
|
||||||
|
container_name: KTVCentral_nginx
|
||||||
|
ports:
|
||||||
|
- "8080:80"
|
||||||
|
volumes:
|
||||||
|
- ./:/var/www/html
|
||||||
|
- ./docker/nginx/default.conf:/etc/nginx/conf.d/default.conf
|
||||||
|
depends_on:
|
||||||
|
- app
|
||||||
|
|
||||||
|
volumes:
|
||||||
|
dbdata:
|
22
docker/nginx/default.conf
Normal file
22
docker/nginx/default.conf
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
server {
|
||||||
|
listen 80;
|
||||||
|
index index.php index.html;
|
||||||
|
server_name localhost;
|
||||||
|
|
||||||
|
root /var/www/html/public;
|
||||||
|
|
||||||
|
location / {
|
||||||
|
try_files $uri $uri/ /index.php?$query_string;
|
||||||
|
}
|
||||||
|
|
||||||
|
location ~ \.php$ {
|
||||||
|
include fastcgi_params;
|
||||||
|
fastcgi_pass app:9000;
|
||||||
|
fastcgi_index index.php;
|
||||||
|
fastcgi_param SCRIPT_FILENAME /var/www/html/public$fastcgi_script_name;
|
||||||
|
}
|
||||||
|
|
||||||
|
location ~ /\.ht {
|
||||||
|
deny all;
|
||||||
|
}
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user