From cf8ee297d8826778d32ee530e8a11cb49556d343 Mon Sep 17 00:00:00 2001 From: Andrew Gioia Date: Mon, 21 Jul 2025 17:26:22 -0400 Subject: [PATCH] Adds beginning docker support --- docker-compose.yml | 43 +++++++++++++++++++++++++++++++++++++++ docker/nginx/default.conf | 22 ++++++++++++++++++++ docker/php/Dockerfile | 9 ++++++++ 3 files changed, 74 insertions(+) create mode 100644 docker-compose.yml create mode 100644 docker/nginx/default.conf create mode 100644 docker/php/Dockerfile diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..2c05d95 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,43 @@ +version: '3.8' + +services: + kithkin-app: + build: + context: . + dockerfile: docker/php/Dockerfile + container_name: kithkin-app + volumes: + - .:/var/www/html + environment: + APP_ENV: production + DB_HOST: kithkin-db + DB_DATABASE: kithkin + DB_USERNAME: kithkin + DB_PASSWORD: secret + depends_on: + - kithkin-db + + kithkin-nginx: + image: nginx:alpine + container_name: kithkin-nginx + ports: + - "8080:80" + volumes: + - .:/var/www/html + - ./docker/nginx/default.conf:/etc/nginx/conf.d/default.conf + depends_on: + - kithkin-app + + kithkin-db: + image: mysql:8 + container_name: kithkin-db + environment: + MYSQL_ROOT_PASSWORD: rootpass + MYSQL_DATABASE: kithkin + MYSQL_USER: kithkin + MYSQL_PASSWORD: secret + volumes: + - kithkin-dbdata:/var/lib/mysql + +volumes: + kithkin-dbdata: diff --git a/docker/nginx/default.conf b/docker/nginx/default.conf new file mode 100644 index 0000000..f114a46 --- /dev/null +++ b/docker/nginx/default.conf @@ -0,0 +1,22 @@ +server { + listen 80; + server_name localhost; + + root /var/www/html/public; + index index.php index.html; + + location / { + try_files $uri $uri/ /index.php?$query_string; + } + + location ~ \.php$ { + include fastcgi_params; + fastcgi_pass kithkin-app:9000; + fastcgi_index index.php; + fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; + } + + location ~ /\.ht { + deny all; + } +} diff --git a/docker/php/Dockerfile b/docker/php/Dockerfile new file mode 100644 index 0000000..93893b9 --- /dev/null +++ b/docker/php/Dockerfile @@ -0,0 +1,9 @@ +FROM php:8.4-fpm + +RUN apt-get update && apt-get install -y \ + git curl zip unzip libpq-dev libonig-dev libxml2-dev libzip-dev \ + && docker-php-ext-install pdo pdo_mysql zip mbstring + +COPY --from=composer:latest /usr/bin/composer /usr/bin/composer + +WORKDIR /var/www/html