Spaces:
Running
Running
Update Dockerfile
Browse files- Dockerfile +27 -14
Dockerfile
CHANGED
|
@@ -1,14 +1,27 @@
|
|
| 1 |
-
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
FROM php:8.2-apache
|
| 2 |
+
|
| 3 |
+
# 1. Install basic dependencies (keep zip/unzip for general use)
|
| 4 |
+
RUN apt-get update && apt-get install -y \
|
| 5 |
+
libpng-dev libonig-dev libxml2-dev zip unzip \
|
| 6 |
+
&& docker-php-ext-install pdo_mysql mbstring exif pcntl bcmath gd
|
| 7 |
+
|
| 8 |
+
# 2. Enable Apache Rewrite module
|
| 9 |
+
RUN a2enmod rewrite
|
| 10 |
+
|
| 11 |
+
# 3. Set Port to 7860 (Hugging Face Requirement)
|
| 12 |
+
RUN sed -i 's/80/7860/g' /etc/apache2/ports.conf /etc/apache2/sites-available/000-default.conf
|
| 13 |
+
|
| 14 |
+
# 4. Set the working directory
|
| 15 |
+
WORKDIR /var/www/html
|
| 16 |
+
|
| 17 |
+
# 5. Copy everything from your repository
|
| 18 |
+
COPY . .
|
| 19 |
+
|
| 20 |
+
# 6. Set permissions for your PHP app folder
|
| 21 |
+
# Use -f (force) so it doesn't crash if the folder is empty
|
| 22 |
+
RUN chown -R www-data:www-data /var/www/html/bank-update || true
|
| 23 |
+
|
| 24 |
+
# 7. Apply the simplified routing
|
| 25 |
+
COPY apache-config.conf /etc/apache2/sites-available/000-default.conf
|
| 26 |
+
|
| 27 |
+
CMD ["apache2-foreground"]
|