kingkay000 commited on
Commit
85c093f
·
verified ·
1 Parent(s): 547795a

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +17 -13
Dockerfile CHANGED
@@ -1,11 +1,15 @@
1
  FROM php:8.2-apache
2
 
3
- # 1. Add older Debian repo specifically for the missing IMAP library
4
- # This is necessary because libc-client-dev was removed in newer Debian versions
5
  RUN echo "deb http://deb.debian.org/debian bullseye main" > /etc/apt/sources.list.d/bullseye.list
6
 
7
- # 2. Install dependencies (including the older libc-client-dev)
8
- # + Added GD build deps: libjpeg62-turbo-dev, libfreetype6-dev, libwebp-dev
 
 
 
 
 
9
  RUN apt-get update && apt-get install -y \
10
  libpng-dev \
11
  libjpeg62-turbo-dev \
@@ -18,32 +22,32 @@ RUN apt-get update && apt-get install -y \
18
  libkrb5-dev \
19
  libssl-dev \
20
  libldap2-dev \
21
- libc-client-dev \
22
  && rm -rf /var/lib/apt/lists/* \
23
- && rm /etc/apt/sources.list.d/bullseye.list
 
24
 
25
- # 3. Configure and Install IMAP
26
  RUN docker-php-ext-configure imap --with-kerberos --with-imap-ssl \
27
  && docker-php-ext-install imap
28
 
29
- # 4. Install PHP extensions: GD + PDO/MySQL
30
- # (Removed duplicate mysqli install)
31
  RUN docker-php-ext-configure gd --with-freetype --with-jpeg --with-webp \
32
  && docker-php-ext-install -j$(nproc) gd pdo pdo_mysql mysqli \
33
  && docker-php-ext-enable mysqli
34
 
35
- # 5. Enable Apache Rewrite and set port
36
  RUN a2enmod rewrite
37
  RUN sed -i 's/80/7860/g' /etc/apache2/ports.conf /etc/apache2/sites-available/000-default.conf
38
 
39
- # 6. Setup files
40
  WORKDIR /var/www/html
41
  COPY . .
42
 
43
- # 7. Set permissions
44
  RUN chown -R www-data:www-data /var/www/html/bank-update || true
45
 
46
- # 8. Link the Apache config
47
  COPY apache-config.conf /etc/apache2/sites-available/000-default.conf
48
 
49
  CMD ["apache2-foreground"]
 
1
  FROM php:8.2-apache
2
 
3
+ # 1) Add bullseye repo ONLY to fetch libc-client-dev (for IMAP)
 
4
  RUN echo "deb http://deb.debian.org/debian bullseye main" > /etc/apt/sources.list.d/bullseye.list
5
 
6
+ # 2) Pin bullseye so it won't "downgrade" other packages (like freetype)
7
+ RUN printf "Package: *\nPin: release n=bullseye\nPin-Priority: 100\n\nPackage: libc-client-dev\nPin: release n=bullseye\nPin-Priority: 990\n" \
8
+ > /etc/apt/preferences.d/pin-bullseye
9
+
10
+ # 3) Install dependencies
11
+ # - GD deps from base distro (no version conflict)
12
+ # - libc-client-dev explicitly from bullseye
13
  RUN apt-get update && apt-get install -y \
14
  libpng-dev \
15
  libjpeg62-turbo-dev \
 
22
  libkrb5-dev \
23
  libssl-dev \
24
  libldap2-dev \
25
+ -t bullseye libc-client-dev \
26
  && rm -rf /var/lib/apt/lists/* \
27
+ && rm -f /etc/apt/sources.list.d/bullseye.list \
28
+ && rm -f /etc/apt/preferences.d/pin-bullseye
29
 
30
+ # 4) Configure & install IMAP
31
  RUN docker-php-ext-configure imap --with-kerberos --with-imap-ssl \
32
  && docker-php-ext-install imap
33
 
34
+ # 5) Install GD + MySQL extensions (remove duplicate mysqli line)
 
35
  RUN docker-php-ext-configure gd --with-freetype --with-jpeg --with-webp \
36
  && docker-php-ext-install -j$(nproc) gd pdo pdo_mysql mysqli \
37
  && docker-php-ext-enable mysqli
38
 
39
+ # 6) Enable Apache Rewrite and set port
40
  RUN a2enmod rewrite
41
  RUN sed -i 's/80/7860/g' /etc/apache2/ports.conf /etc/apache2/sites-available/000-default.conf
42
 
43
+ # 7) Setup files
44
  WORKDIR /var/www/html
45
  COPY . .
46
 
47
+ # 8) Set permissions
48
  RUN chown -R www-data:www-data /var/www/html/bank-update || true
49
 
50
+ # 9) Link the Apache config
51
  COPY apache-config.conf /etc/apache2/sites-available/000-default.conf
52
 
53
  CMD ["apache2-foreground"]