Adds beginning docker support
This commit is contained in:
parent
a82d9fe01f
commit
cf8ee297d8
43
docker-compose.yml
Normal file
43
docker-compose.yml
Normal 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
22
docker/nginx/default.conf
Normal 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
9
docker/php/Dockerfile
Normal 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
|
Loading…
Reference in New Issue
Block a user