diff --git a/dev/nginx/nginx.conf b/dev/nginx/nginx.conf new file mode 100644 index 0000000..60c7987 --- /dev/null +++ b/dev/nginx/nginx.conf @@ -0,0 +1,20 @@ +server { + listen 80 default_server; + listen [::]:80 default_server; + + server_name slovocast; + + root /var/www/slovocast/public; + index index.php index.html; + + location / { + try_files $uri $uri/ /index.php?$args; + } + + location ~* \.php$ { + fastcgi_pass php:9000; + include fastcgi_params; + fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; + fastcgi_param SCRIPT_NAME $fastcgi_script_name; + } +} diff --git a/dev/php/Dockerfile b/dev/php/Dockerfile new file mode 100644 index 0000000..b5944b6 --- /dev/null +++ b/dev/php/Dockerfile @@ -0,0 +1,9 @@ +FROM php:8.3-fpm + +RUN apt-get update && \ + apt-get install -y libonig-dev \ + zip \ + libzip-dev \ + libpng-dev + +RUN docker-php-ext-install pdo pdo_mysql mbstring gd zip diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..12b0ddf --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,29 @@ +version: '3.8' +services: + php: + build: + dockerfile: 'dev/php/Dockerfile' + volumes: + - './app:/var/www/slovocast' + depends_on: + - mariadb + nginx: + image: nginx:latest + volumes: + - './app:/var/www/slovocast' + - './dev/nginx:/etc/nginx/conf.d' + ports: + - "8080:80" + depends_on: + - php + mariadb: + image: mariadb:10.9 + environment: + MYSQL_ROOT_PASSWORD: "P4ssword!" + MYSQL_DATABASE: "slovocast" + MYSQL_USER: "slovocast" + MYSQL_PASSWORD: "slovocast" + volumes: + - "slovocast_data:/var/lib/mysql" +volumes: + slovocast_data: