php-hosting / Dockerfile
Emalawi19's picture
Update Dockerfile
690dc7d verified
Raw
History Blame Contribute Delete
963 Bytes
FROM php:8.2-apache
RUN sed -i 's/80/7860/g' /etc/apache2/ports.conf \
/etc/apache2/sites-enabled/000-default.conf
RUN apt-get update && apt-get install -y --no-install-recommends \
sqlite3 libsqlite3-dev unzip curl \
&& rm -rf /var/lib/apt/lists/*
RUN docker-php-ext-install pdo pdo_sqlite mysqli opcache mbstring
RUN a2enmod rewrite headers
COPY api/ /var/www/api/
RUN echo 'ServerName localhost' >> /etc/apache2/apache2.conf
RUN printf '<VirtualHost *:7860>\n\
DocumentRoot /var/www/html\n\
Alias /api /var/www/api\n\
<Directory /var/www/api>\n\
Options -Indexes +FollowSymLinks\n\
AllowOverride All\n\
Require all granted\n\
</Directory>\n\
<Directory /data/sites>\n\
Options -Indexes +FollowSymLinks\n\
AllowOverride All\n\
Require all granted\n\
</Directory>\n\
</VirtualHost>\n' > /etc/apache2/sites-enabled/000-default.conf
EXPOSE 7860
CMD ["apache2-foreground"]