Spaces:
Build error
Build error
Update Dockerfile
Browse files- Dockerfile +46 -2
Dockerfile
CHANGED
|
@@ -1,7 +1,51 @@
|
|
| 1 |
FROM php:8.2-apache
|
| 2 |
|
| 3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4 |
|
| 5 |
EXPOSE 7860
|
| 6 |
|
| 7 |
-
CMD ["
|
|
|
|
| 1 |
FROM php:8.2-apache
|
| 2 |
|
| 3 |
+
# Fix port
|
| 4 |
+
RUN sed -i 's/80/7860/g' /etc/apache2/ports.conf \
|
| 5 |
+
/etc/apache2/sites-enabled/000-default.conf
|
| 6 |
+
|
| 7 |
+
# System dependencies
|
| 8 |
+
RUN apt-get update && apt-get install -y --no-install-recommends \
|
| 9 |
+
libpng-dev libjpeg-dev libfreetype6-dev \
|
| 10 |
+
libzip-dev libicu-dev libxml2-dev \
|
| 11 |
+
sqlite3 libsqlite3-dev unzip curl \
|
| 12 |
+
&& rm -rf /var/lib/apt/lists/*
|
| 13 |
+
|
| 14 |
+
# PHP extensions
|
| 15 |
+
RUN docker-php-ext-configure gd --with-freetype --with-jpeg \
|
| 16 |
+
&& docker-php-ext-install -j"$(nproc)" \
|
| 17 |
+
gd pdo pdo_sqlite mysqli zip intl opcache mbstring xml
|
| 18 |
+
|
| 19 |
+
# Apache modules
|
| 20 |
+
RUN a2enmod rewrite headers
|
| 21 |
+
|
| 22 |
+
# PHP config
|
| 23 |
+
COPY config/php.ini /usr/local/etc/php/conf.d/99-custom.ini
|
| 24 |
+
|
| 25 |
+
# API files
|
| 26 |
+
COPY api/ /var/www/api/
|
| 27 |
+
|
| 28 |
+
# Apache config — write directly, no external file needed
|
| 29 |
+
RUN echo 'ServerName localhost' >> /etc/apache2/apache2.conf && \
|
| 30 |
+
printf '<VirtualHost *:7860>\n\
|
| 31 |
+
DocumentRoot /var/www/html\n\
|
| 32 |
+
Alias /api /var/www/api\n\
|
| 33 |
+
<Directory /var/www/api>\n\
|
| 34 |
+
Options -Indexes +FollowSymLinks\n\
|
| 35 |
+
AllowOverride All\n\
|
| 36 |
+
Require all granted\n\
|
| 37 |
+
</Directory>\n\
|
| 38 |
+
<Directory /data/sites>\n\
|
| 39 |
+
Options -Indexes +FollowSymLinks\n\
|
| 40 |
+
AllowOverride All\n\
|
| 41 |
+
Require all granted\n\
|
| 42 |
+
</Directory>\n\
|
| 43 |
+
</VirtualHost>\n' > /etc/apache2/sites-enabled/000-default.conf
|
| 44 |
+
|
| 45 |
+
# Entrypoint
|
| 46 |
+
COPY entrypoint.sh /entrypoint.sh
|
| 47 |
+
RUN sed -i 's/\r$//' /entrypoint.sh && chmod +x /entrypoint.sh
|
| 48 |
|
| 49 |
EXPOSE 7860
|
| 50 |
|
| 51 |
+
CMD ["/bin/bash", "/entrypoint.sh"]
|