kingkay000 commited on
Commit
2c09acc
·
verified ·
1 Parent(s): 26102f1

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +27 -14
Dockerfile CHANGED
@@ -1,14 +1,27 @@
1
- <VirtualHost *:7860>
2
- DocumentRoot /var/www/html
3
-
4
- # Route for your current PHP App
5
- Alias /php /var/www/html/bank-update
6
- <Directory /var/www/html/bank-update>
7
- Options Indexes FollowSymLinks
8
- AllowOverride All
9
- Require all granted
10
- </Directory>
11
-
12
- # Future-proof: Redirect the root URL to your PHP app for now
13
- RedirectMatch ^/$ /php/
14
- </VirtualHost>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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"]