This commit is contained in:
Lain Iwakura 2025-07-24 05:17:13 +03:00
parent 27c3f1662d
commit 0e9d6c681f
No known key found for this signature in database
GPG Key ID: C7C18257F2ADC6F8
7 changed files with 85 additions and 4 deletions

8
.dockerignore Normal file
View File

@ -0,0 +1,8 @@
.git
.gitignore
README
docker-compose.yml
Dockerfile
.dockerignore
uploads/*
!uploads/.gitkeep

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
config.php

21
Dockerfile Normal file
View File

@ -0,0 +1,21 @@
FROM php:8.1-apache
RUN apt-get update && apt-get install -y \
libpng-dev \
libjpeg-dev \
libfreetype6-dev \
libwebp-dev \
&& docker-php-ext-configure gd --with-freetype --with-jpeg --with-webp \
&& docker-php-ext-install -j$(nproc) gd pdo pdo_mysql
RUN a2enmod rewrite
COPY . /var/www/html/
COPY apache.conf /etc/apache2/sites-available/000-default.conf
RUN chown -R www-data:www-data /var/www/html \
&& chmod -R 755 /var/www/html/uploads
EXPOSE 65511
CMD ["apache2-foreground"]

16
apache.conf Normal file
View File

@ -0,0 +1,16 @@
<VirtualHost *:65511>
DocumentRoot /var/www/html
ServerName localhost
<Directory /var/www/html>
AllowOverride All
Require all granted
</Directory>
<Directory /var/www/html/uploads>
Require all granted
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>

View File

@ -1,10 +1,10 @@
<?php
return [
'db' => [
'host' => 'localhost',
'name' => 'mkach',
'user' => 'mkach',
'pass' => 'your_password'
'host' => $_ENV['DB_HOST'] ?? 'mysql',
'name' => $_ENV['DB_NAME'] ?? 'mkach',
'user' => $_ENV['DB_USER'] ?? 'mkach',
'pass' => $_ENV['DB_PASS'] ?? 'mkach'
],
'access_key' => 'mkalwaysthebest1337',
'upload_path' => 'uploads/',

34
docker-compose.yml Normal file
View File

@ -0,0 +1,34 @@
version: '3.8'
services:
mysql:
image: mysql:8.0
environment:
MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: mkach
MYSQL_USER: mkach
MYSQL_PASSWORD: mkach
ports:
- "3306:3306"
volumes:
- mysql_data:/var/lib/mysql
- ./sql/create.sql:/docker-entrypoint-initdb.d/create.sql
mkach:
build: .
ports:
- "65511:65511"
depends_on:
- mysql
environment:
- APACHE_RUN_USER=www-data
- APACHE_RUN_GROUP=www-data
- DB_HOST=mysql
- DB_NAME=mkach
- DB_USER=mkach
- DB_PASS=mkach
volumes:
- ./uploads:/var/www/html/uploads
volumes:
mysql_data:

1
uploads/.gitkeep Normal file
View File

@ -0,0 +1 @@