Emalawi19 commited on
Commit
f4f7eaa
·
verified ·
1 Parent(s): ca64fe4

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +25 -34
Dockerfile CHANGED
@@ -1,49 +1,40 @@
1
  FROM php:8.2-apache
2
 
3
- # System dependencies
4
  RUN apt-get update && apt-get install -y --no-install-recommends \
5
- libpng-dev \
6
- libjpeg-dev \
7
- libfreetype6-dev \
8
- libzip-dev \
9
- libicu-dev \
10
- libxml2-dev \
11
- sqlite3 \
12
- libsqlite3-dev \
13
- unzip \
14
- curl \
15
  && rm -rf /var/lib/apt/lists/*
16
 
17
- # PHP extensions
18
  RUN docker-php-ext-configure gd --with-freetype --with-jpeg \
19
- && docker-php-ext-install -j"$(nproc)" \
20
- gd \
21
- pdo \
22
- pdo_sqlite \
23
- mysqli \
24
- zip \
25
- intl \
26
- opcache \
27
- mbstring \
28
- xml
29
-
30
- # Apache modules
31
- RUN a2enmod rewrite vhost_alias headers
32
-
33
- # Copy config files
34
- COPY config/php.ini /usr/local/etc/php/conf.d/99-custom.ini
35
- COPY config/apache.conf /etc/apache2/sites-available/platform.conf
36
 
37
- # Copy backend PHP API files
38
  COPY api/ /var/www/api/
39
 
40
- # Copy entrypoint and set permissions in the same layer
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
41
  COPY entrypoint.sh /entrypoint.sh
42
  RUN sed -i 's/\r$//' /entrypoint.sh && chmod +x /entrypoint.sh
43
 
44
- # Enable our site, disable default
45
- RUN a2dissite 000-default && a2ensite platform
46
-
47
  EXPOSE 7860
48
 
49
  CMD ["/bin/bash", "/entrypoint.sh"]
 
1
  FROM php:8.2-apache
2
 
 
3
  RUN apt-get update && apt-get install -y --no-install-recommends \
4
+ libpng-dev libjpeg-dev libfreetype6-dev \
5
+ libzip-dev libicu-dev libxml2-dev \
6
+ sqlite3 libsqlite3-dev unzip curl \
 
 
 
 
 
 
 
7
  && rm -rf /var/lib/apt/lists/*
8
 
 
9
  RUN docker-php-ext-configure gd --with-freetype --with-jpeg \
10
+ && docker-php-ext-install -j"$(nproc)" gd pdo pdo_sqlite mysqli zip intl opcache mbstring xml
11
+
12
+ RUN a2enmod rewrite headers
 
 
 
 
 
 
 
 
 
 
 
 
 
 
13
 
14
+ COPY config/php.ini /usr/local/etc/php/conf.d/99-custom.ini
15
  COPY api/ /var/www/api/
16
 
17
+ RUN echo 'Listen 7860' > /etc/apache2/ports.conf && \
18
+ echo '<VirtualHost *:7860>' > /etc/apache2/sites-enabled/000-default.conf && \
19
+ echo ' DocumentRoot /var/www/html' >> /etc/apache2/sites-enabled/000-default.conf && \
20
+ echo ' Alias /api /var/www/api' >> /etc/apache2/sites-enabled/000-default.conf && \
21
+ echo ' <Directory /var/www/api>' >> /etc/apache2/sites-enabled/000-default.conf && \
22
+ echo ' Options -Indexes +FollowSymLinks' >> /etc/apache2/sites-enabled/000-default.conf && \
23
+ echo ' AllowOverride All' >> /etc/apache2/sites-enabled/000-default.conf && \
24
+ echo ' Require all granted' >> /etc/apache2/sites-enabled/000-default.conf && \
25
+ echo ' </Directory>' >> /etc/apache2/sites-enabled/000-default.conf && \
26
+ echo ' <Directory /data/sites>' >> /etc/apache2/sites-enabled/000-default.conf && \
27
+ echo ' Options -Indexes +FollowSymLinks' >> /etc/apache2/sites-enabled/000-default.conf && \
28
+ echo ' AllowOverride All' >> /etc/apache2/sites-enabled/000-default.conf && \
29
+ echo ' Require all granted' >> /etc/apache2/sites-enabled/000-default.conf && \
30
+ echo ' </Directory>' >> /etc/apache2/sites-enabled/000-default.conf && \
31
+ echo ' ErrorLog /data/logs/apache_error.log' >> /etc/apache2/sites-enabled/000-default.conf && \
32
+ echo ' CustomLog /data/logs/apache_access.log combined' >> /etc/apache2/sites-enabled/000-default.conf && \
33
+ echo '</VirtualHost>' >> /etc/apache2/sites-enabled/000-default.conf
34
+
35
  COPY entrypoint.sh /entrypoint.sh
36
  RUN sed -i 's/\r$//' /entrypoint.sh && chmod +x /entrypoint.sh
37
 
 
 
 
38
  EXPOSE 7860
39
 
40
  CMD ["/bin/bash", "/entrypoint.sh"]