Adds beginning docker support

This commit is contained in:
Andrew Gioia 2025-07-21 17:26:22 -04:00
parent a82d9fe01f
commit cf8ee297d8
Signed by: andrew
GPG Key ID: FC09694A000800C8
3 changed files with 74 additions and 0 deletions

43
docker-compose.yml Normal file
View File

@ -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:

22
docker/nginx/default.conf Normal file
View File

@ -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;
}
}

9
docker/php/Dockerfile Normal file
View File

@ -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