Skip to content

Commit 3b00d3e

Browse files
committed
feat: use debian-slim instead of alpine as base image
1 parent fbc7c3c commit 3b00d3e

File tree

2 files changed

+57
-32
lines changed

2 files changed

+57
-32
lines changed

Dockerfile

Lines changed: 53 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,45 @@
1-
FROM php:8.5-fpm-alpine AS base
2-
3-
ENV DIRBROWSER_VERSION=4.3.1
4-
5-
RUN apk update && apk upgrade
6-
7-
RUN apk add --no-cache libzip-dev \
8-
&& docker-php-ext-configure zip \
9-
&& docker-php-ext-install zip
10-
11-
RUN apk add --no-cache autoconf build-base \
12-
&& pecl install -o -f redis \
13-
&& rm -rf /tmp/pear \
14-
&& docker-php-ext-enable redis \
15-
&& apk del autoconf build-base
16-
17-
RUN apk add --no-cache redis
18-
19-
RUN apk add --no-cache nginx
20-
21-
RUN apk add --no-cache bash
22-
23-
RUN apk add --no-cache curl \
24-
&& curl -fSsL https://github.com/adrianschubek/utpp/releases/download/0.5.0/utpp-alpine -o /usr/local/bin/utpp && chmod +x /usr/local/bin/utpp\
25-
&& apk del curl
26-
27-
RUN apk add --no-cache composer
1+
FROM debian:trixie-slim AS base
2+
3+
ENV DIRBROWSER_VERSION=4.3.2
4+
5+
ENV DEBIAN_FRONTEND=noninteractive
6+
7+
RUN set -eux; \
8+
apt-get update; \
9+
apt-get install -y --no-install-recommends \
10+
ca-certificates \
11+
curl \
12+
gnupg \
13+
lsb-release \
14+
apt-transport-https \
15+
unzip \
16+
bash \
17+
nginx \
18+
redis-server; \
19+
rm -rf /var/lib/apt/lists/*
20+
21+
# Install PHP 8.5 from Sury (https://packages.sury.org/php/README.txt)
22+
RUN set -eux; \
23+
curl -fsSL https://packages.sury.org/php/apt.gpg -o /etc/apt/trusted.gpg.d/php.gpg; \
24+
echo "deb https://packages.sury.org/php/ $(lsb_release -sc) main" > /etc/apt/sources.list.d/php.list; \
25+
apt-get update; \
26+
apt-get install -y --no-install-recommends \
27+
php8.5-cli \
28+
php8.5-fpm \
29+
php8.5-mbstring \
30+
php8.5-zip \
31+
php8.5-redis; \
32+
ln -sf /usr/bin/php8.5 /usr/local/bin/php; \
33+
rm -rf /var/lib/apt/lists/*
34+
35+
RUN set -eux; \
36+
curl -fSsL https://github.com/adrianschubek/utpp/releases/download/0.5.0/utpp-linux -o /usr/local/bin/utpp; \
37+
chmod +x /usr/local/bin/utpp
38+
39+
RUN set -eux; \
40+
curl -fsSL https://getcomposer.org/installer -o /tmp/composer-setup.php; \
41+
php8.5 /tmp/composer-setup.php --install-dir=/usr/local/bin --filename=composer; \
42+
rm -f /tmp/composer-setup.php
2843

2944
WORKDIR /var/www/html
3045

@@ -40,9 +55,12 @@ COPY server/nginx/nginx.conf /etc/nginx/nginx.conf
4055

4156
COPY server/nginx/conf.d/default.conf /etc/nginx/conf.d/default.conf
4257

43-
COPY server/php/fpm-pool.conf /usr/local/etc/php-fpm.d/www.conf
58+
COPY server/php/fpm-pool.conf /etc/php/8.5/fpm/pool.d/www.conf
59+
60+
COPY server/php/php.ini /etc/php/8.5/fpm/conf.d/99-custom.ini
61+
COPY server/php/php.ini /etc/php/8.5/cli/conf.d/99-custom.ini
4462

45-
COPY server/php/php.ini /usr/local/etc/php/conf.d/custom.ini
63+
COPY server/redis/redis.conf /etc/redis/redis.conf
4664

4765
COPY src/index.php /var/www/html
4866

@@ -135,6 +153,12 @@ ENV AUTH_COOKIE_HTTPONLY=true
135153

136154
ENV TITLE="dir-browser"
137155

156+
ENV MEM_LIMIT=-1
157+
158+
ENV MAX_EXEC_TIME=600
159+
160+
ENV DISPLAY_ERRORS=Off
161+
138162
EXPOSE 8080
139163

140164
CMD ["/init.sh"]

src/init.sh

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,10 @@ fi
2929

3030

3131
echo -e "${YELLOW}[ 1/$MAX_STEPS ] Pre-processing configs using utpp... ${NC}"
32-
utpp "/etc/nginx/**;/usr/local/etc/php*/**;/var/www/html/*.php"
32+
utpp "/etc/nginx/**;/etc/php/**;/var/www/html/*.php"
3333

3434
echo -e "${YELLOW}[ 2/$MAX_STEPS ] Starting php-fpm... ${NC}"
35-
php-fpm -RF &
35+
php-fpm8.5 -F -R &
3636

3737
# skipped in v3.9
3838
# echo -e "${YELLOW}[ 3/$MAX_STEPS ] Starting worker... ${NC}"
@@ -42,7 +42,8 @@ echo -e "${YELLOW}[ 3/$MAX_STEPS ] Starting nginx... ${NC}"
4242
nginx -g 'daemon off;' &
4343

4444
echo -e "${YELLOW}[ 4/$MAX_STEPS ] Starting redis... ${NC}"
45-
redis-server /etc/redis.conf --save 60 1 &
45+
mkdir -p /run/redis
46+
redis-server /etc/redis/redis.conf --save 60 1 &
4647

4748
echo -e "${GREEN}[ 5/$MAX_STEPS ] All services running!${NC}"
4849
wait -n

0 commit comments

Comments
 (0)