ladogton2010 commited on
Commit
8b5b828
·
1 Parent(s): f8aa971
Files changed (2) hide show
  1. .htaccess +5 -0
  2. Dockerfile +95 -4
.htaccess ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
 
1
+ <IfModule mod_rewrite.c>
2
+ RewriteEngine on
3
+ RewriteRule ^$ public/ [L]
4
+ RewriteRule (.*) public/$1 [L]
5
+ </IfModule>
Dockerfile CHANGED
@@ -1,10 +1,101 @@
1
  FROM debian:12.6
 
2
 
3
  RUN apt update -y
4
  RUN apt upgrade -y
5
- RUN apt install -y php php-pdo php-mysql
6
 
7
- COPY app app
8
- COPY public public
 
9
 
10
- CMD [ "bash", "-c", "php -S 0.0.0.0:7860" ]
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  FROM debian:12.6
2
+ ARG DEBIAN_FRONTEND=noninteractive
3
 
4
  RUN apt update -y
5
  RUN apt upgrade -y
6
+ # RUN apt install -y php php-pdo php-mysql
7
 
8
+ COPY app /home/user/apache2/htdocs/app
9
+ COPY public /home/user/apache2/htdocs/public
10
+ COPY .htaccess /home/user/apache2/htdocs/.htaccess
11
 
12
+ RUN apt update -y
13
+ RUN apt upgrade -y
14
+ RUN apt install -y dialog apt-utils
15
+ RUN apt install -y curl unzip wget xz-utils gcc make libapr1-dev libaprutil1-dev libpcre3 libpcre3-dev
16
+ RUN apt search "Apache Portable Runtime Library"
17
+ RUN apt search "Apache Portable Runtime Utility "
18
+ RUN apt install -y libtool libapr1 libaprutil1 libtool-bin
19
+
20
+ RUN useradd -m -u 1000 user
21
+ # USER user
22
+ WORKDIR /home/user
23
+ RUN wget https://dlcdn.apache.org/httpd/httpd-2.4.62.tar.gz
24
+ RUN tar -xf httpd-2.4.62.tar.gz
25
+ RUN cd httpd-2.4.62
26
+ WORKDIR /home/user/httpd-2.4.62
27
+ RUN ls -la
28
+
29
+
30
+ RUN echo
31
+ RUN echo ===================================================================
32
+ RUN cat README
33
+ RUN echo
34
+ RUN echo ===================================================================
35
+ RUN cat README
36
+ RUN echo
37
+ RUN echo ===================================================================
38
+ RUN echo
39
+ RUN cat INSTALL
40
+ RUN echo ===================================================================
41
+ RUN echo
42
+
43
+
44
+ RUN ./configure --prefix=/home/user/apache2 --enable-so
45
+ RUN make
46
+ RUN make install
47
+ # $HOME/apache
48
+ # /apache2/conf/httpd.conf
49
+
50
+ RUN chmod 777 -R /home/user/apache2
51
+ RUN ls -la /home/user/apache2/bin
52
+ RUN sed -i 's/Listen 80/Listen 7860/' /home/user/apache2/conf/httpd.conf
53
+ RUN cat /home/user/apache2/conf/httpd.conf
54
+ # RUN /apache2/bin/apachectl start
55
+ RUN rm -rf /home/user/httpd-2.4.62
56
+
57
+ USER root
58
+ RUN apt install -y locate
59
+ RUN updatedb
60
+ # USER user
61
+
62
+ RUN ls /home/user/apache2/bin/ -la
63
+ RUN cp -r /home/user/apache2/bin/ /usr/bin/
64
+ RUN ls /usr/bin/ -la
65
+ USER user
66
+ RUN /home/user/apache2/bin/apachectl start; /home/user/apache2/bin/apachectl stop; /home/user/apache2/bin/apachectl stop
67
+ RUN rm /home/user/apache2/htdocs/index.html
68
+
69
+ USER root
70
+
71
+ WORKDIR /home/user
72
+ RUN apt install -y libxml2 libxml2-dev libsqlite3-dev libssl-dev libz-dev libpng-dev perl pkg-config
73
+ RUN apt install -y libapache2-mod-php8.2 autoconf automake re2c bison
74
+ RUN wget https://www.php.net/distributions/php-8.3.12.tar.gz
75
+ RUN tar -xf php-8.3.12.tar.gz
76
+ RUN cd php-8.3.12
77
+ WORKDIR /home/user/php-8.3.12
78
+ RUN ls -la
79
+ # RUN ./configure --with-apxs2=/home/user/apache2/bin/apxs --with-mysql
80
+ RUN ./configure --with-apxs2=/home/user/apache2/bin/apxs --with-pdo-mysql
81
+ RUN make
82
+ RUN make install
83
+ RUN apt install -y php-xml php-sqlite3
84
+ # USER user
85
+
86
+ COPY index.php /home/user/apache2/htdocs/index.php
87
+ COPY test.html /home/user/apache2/htdocs/test.html
88
+
89
+ RUN sed -i 's/DirectoryIndex index.html/DirectoryIndex index.php index.html/' /home/user/apache2/conf/httpd.conf
90
+ RUN echo "LoadModule php_module modules/libphp.so" >> /home/user/apache2/conf/httpd.conf
91
+ RUN echo "" >> /home/user/apache2/conf/httpd.conf
92
+ RUN echo "<FilesMatch \.php$>" >> /home/user/apache2/conf/httpd.conf
93
+ RUN echo "SetHandler application/x-httpd-php" >> /home/user/apache2/conf/httpd.conf
94
+ RUN echo "</FilesMatch>" >> /home/user/apache2/conf/httpd.conf
95
+ # RUN which php-cgi;
96
+ # RUN a2enmod php
97
+ RUN which php
98
+ RUN updatedb
99
+ RUN locate index.php;
100
+ USER user
101
+ CMD [ "bash","-c", "/home/user/apache2/bin/apachectl start; curl localhost:7860; tail -F error.log" ]