83 lines
2.1 KiB
Docker
83 lines
2.1 KiB
Docker
FROM php:7.3-apache-buster
|
||
|
||
# Debian Buster EOL olduğu için repo adreslerini archive'a taşıyoruz
|
||
RUN sed -i 's|http://deb.debian.org/debian|http://archive.debian.org/debian|g' /etc/apt/sources.list \
|
||
&& sed -i 's|http://security.debian.org/debian-security|http://archive.debian.org/debian-security|g' /etc/apt/sources.list \
|
||
&& sed -i '/buster-updates/d' /etc/apt/sources.list \
|
||
&& apt-get update
|
||
|
||
# Sistem paketleri + PHP extension kurulumu
|
||
RUN apt-get install -y --no-install-recommends \
|
||
git \
|
||
unzip \
|
||
zip \
|
||
nano \
|
||
curl \
|
||
libzip-dev \
|
||
libpng-dev \
|
||
libjpeg-dev \
|
||
libfreetype6-dev \
|
||
libxml2-dev \
|
||
zlib1g-dev \
|
||
libonig-dev \
|
||
&& docker-php-ext-configure gd \
|
||
--with-freetype-dir=/usr/include/ \
|
||
--with-jpeg-dir=/usr/include/ \
|
||
&& docker-php-ext-install \
|
||
pdo \
|
||
pdo_mysql \
|
||
gd \
|
||
zip \
|
||
mbstring \
|
||
exif \
|
||
&& rm -rf /var/lib/apt/lists/*
|
||
|
||
# Composer 2.2 kurulumu - PHP 7.3 için güvenli sürüm
|
||
RUN php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" \
|
||
&& php composer-setup.php --2.2 --install-dir=/usr/local/bin --filename=composer \
|
||
&& php -r "unlink('composer-setup.php');"
|
||
|
||
# Apache modları
|
||
RUN a2enmod rewrite
|
||
|
||
# Apache VirtualHost ayarı
|
||
RUN cat > /etc/apache2/sites-available/000-default.conf <<'EOF'
|
||
<VirtualHost *:80>
|
||
ServerName localhost
|
||
ServerAdmin webmaster@localhost
|
||
|
||
DocumentRoot /var/www/html/public
|
||
|
||
<Directory /var/www/html/public>
|
||
Options FollowSymLinks
|
||
AllowOverride All
|
||
Require all granted
|
||
</Directory>
|
||
|
||
<Directory /var/www/html>
|
||
AllowOverride All
|
||
Require all granted
|
||
</Directory>
|
||
|
||
Alias /uploads /home/uploads
|
||
|
||
<Directory /home/uploads>
|
||
Options FollowSymLinks
|
||
AllowOverride None
|
||
Require all granted
|
||
</Directory>
|
||
|
||
ErrorLog ${APACHE_LOG_DIR}/error.log
|
||
CustomLog ${APACHE_LOG_DIR}/access.log combined
|
||
</VirtualHost>
|
||
EOF
|
||
|
||
# Upload klasörü
|
||
RUN mkdir -p /home/uploads \
|
||
&& chown -R www-data:www-data /home/uploads \
|
||
&& chmod -R 775 /home/uploads
|
||
|
||
WORKDIR /var/www/html
|
||
|
||
CMD ["apache2-foreground"]
|