mfoud444 commited on
Commit
94944ab
1 Parent(s): e8451d2

first commit

Browse files
Files changed (1) hide show
  1. Dockerfile +31 -20
Dockerfile CHANGED
@@ -1,30 +1,41 @@
1
- # Use the official PHP image with Apache
2
- FROM php:8.1-apache
3
 
4
- # Set the working directory inside the container
5
- WORKDIR /var/www/html
 
 
 
 
 
 
 
 
 
 
6
 
7
- # Copy the current directory contents into the container
8
- COPY web /var/www/html
 
9
 
10
- RUN ls
11
- # Install additional PHP extensions (if needed)
12
- RUN docker-php-ext-install mysqli pdo pdo_mysql
13
 
14
- # Give the Apache user proper permissions to the project directory
15
- RUN chown -R www-data:www-data /var/www/html
16
 
17
- RUN echo "ServerName 127.0.0.1" | tee /etc/apache2/conf-available/servername.conf
18
- RUN service apache2 reload
19
- RUN a2enconf servername
20
 
21
- # Enable Apache mod_rewrite (if using clean URLs)
22
- RUN a2enmod rewrite
23
 
 
 
24
 
25
 
26
- # Expose port 80 for the web server
27
- EXPOSE 7860
 
 
 
 
 
28
 
29
- # Start Apache in the foreground
30
- CMD ["apache2-foreground"]
 
1
+ # # Use the official PHP image with Apache
2
+ # FROM php:8.1-apache
3
 
4
+ # # Set the working directory inside the container
5
+ # WORKDIR /var/www/html
6
+
7
+ # # Copy the current directory contents into the container
8
+ # COPY web /var/www/html
9
+
10
+ # RUN ls
11
+ # # Install additional PHP extensions (if needed)
12
+ # RUN docker-php-ext-install mysqli pdo pdo_mysql
13
+
14
+ # # Give the Apache user proper permissions to the project directory
15
+ # RUN chown -R www-data:www-data /var/www/html
16
 
17
+ # RUN echo "ServerName 127.0.0.1" | tee /etc/apache2/conf-available/servername.conf
18
+ # RUN service apache2 reload
19
+ # RUN a2enconf servername
20
 
21
+ # # Enable Apache mod_rewrite (if using clean URLs)
22
+ # RUN a2enmod rewrite
 
23
 
 
 
24
 
 
 
 
25
 
26
+ # # Expose port 80 for the web server
27
+ # EXPOSE 7860
28
 
29
+ # # Start Apache in the foreground
30
+ # CMD ["apache2-foreground"]
31
 
32
 
33
+ FROM php:apache
34
+
35
+ WORKDIR /var/www/html
36
+ COPY web .
37
+
38
+ ENV PORT=7860
39
+ EXPOSE ${PORT}
40
 
41
+ RUN sed -i 's/Listen 80/Listen ${PORT}/' /etc/apache2/ports.conf