diff --git a/docker-compose.yaml b/docker-compose.yaml new file mode 100644 index 0000000..4e27c78 --- /dev/null +++ b/docker-compose.yaml @@ -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: \ No newline at end of file diff --git a/docker/nginx/default.conf b/docker/nginx/default.conf new file mode 100644 index 0000000..f313856 --- /dev/null +++ b/docker/nginx/default.conf @@ -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; + } +} \ No newline at end of file