Skip to content

Commit

Permalink
alpine/debian images tested with postgres
Browse files Browse the repository at this point in the history
  • Loading branch information
sstidl committed Oct 26, 2024
1 parent 635ac50 commit 0c31f1d
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 37 deletions.
25 changes: 9 additions & 16 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,20 +1,13 @@
FROM php:8-apache

# use docker-php-extension-installer for automatically get the right packages installed
ADD --chmod=0755 https://github.com/mlocati/docker-php-extension-installer/releases/latest/download/install-php-extensions /usr/local/bin/


# Install extensions
RUN apt-get update && apt-get install -y --no-install-recommends \
libfreetype6-dev \
libjpeg62-turbo-dev \
libpng-dev \
libpq-dev \
&& docker-php-ext-install -j$(nproc) iconv \
&& docker-php-ext-configure gd --with-freetype=/usr/include/ --with-jpeg=/usr/include/ \
&& docker-php-ext-configure pgsql -with-pgsql=/usr/local/pgsql \
&& docker-php-ext-install -j$(nproc) gd pdo pdo_mysql pdo_pgsql pgsql \
&& rm -f /usr/src/php.tar.xz /usr/src/php.tar.xz.asc \
&& apt-get remove -y libfreetype6-dev \
libjpeg62-turbo-dev \
libpng-dev \
libpq-dev \
RUN install-php-extensions iconv gd pdo pdo_mysql pdo_pgsql pgsql

RUN rm -f /usr/src/php.tar.xz /usr/src/php.tar.xz.asc \
&& apt autoremove -y \
&& rm -rf /var/lib/apt/lists/*

Expand Down Expand Up @@ -42,11 +35,11 @@ ENV PASSWORD=password
ENV TELEMETRY=false
ENV ENABLE_ID_OBFUSCATION=false
ENV REDACT_IP_ADDRESSES=false
ENV WEBPORT=80
ENV WEBPORT=8080

# https://httpd.apache.org/docs/2.4/stopping.html#gracefulstop
STOPSIGNAL SIGWINCH

# Final touches
EXPOSE 80
EXPOSE ${WEBPORT}
CMD ["bash", "/entrypoint.sh"]
42 changes: 21 additions & 21 deletions Dockerfile.alpine
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
FROM php:8-alpine

# Install extensions
RUN apk add --quiet --no-cache \
bash \
apache2 \
apache2-ssl \
php83-apache2 \
php83-ctype \
php83-openssl \
freetype-dev \
libjpeg-turbo-dev \
libpng-dev \
libpq-dev \
&& docker-php-ext-configure gd --with-freetype=/usr/include/ --with-jpeg=/usr/include/ \
&& docker-php-ext-configure pgsql -with-pgsql=/usr/local/pgsql \
&& docker-php-ext-install -j$(nproc) gd pdo pdo_mysql pdo_pgsql pgsql \
&& rm -f /usr/src/php.tar.xz /usr/src/php.tar.xz.asc \
&& apk del --quiet --no-cache \
freetype-dev \
libjpeg-turbo-dev \
libpng-dev \
libpq-dev
php-apache2 \
php-ctype \
php-gd \
php-openssl \
php-pdo \
php-pdo_mysql \
php-pdo_pgsql \
php-pdo_sqlite \
php-pgsql \
php-session \
php-sqlite3

# use docker-php-extension-installer for automatically get the right packages installed
ADD --chmod=0755 https://github.com/mlocati/docker-php-extension-installer/releases/latest/download/install-php-extensions /usr/local/bin/



# Install extensions
RUN install-php-extensions iconv gd pdo pdo_mysql pdo_pgsql pgsql

RUN ln -sf /dev/stdout /var/log/apache2/access.log && \
ln -sf /dev/stderr /var/log/apache2/error.log
Expand Down Expand Up @@ -49,11 +49,11 @@ ENV PASSWORD=password
ENV TELEMETRY=false
ENV ENABLE_ID_OBFUSCATION=false
ENV REDACT_IP_ADDRESSES=false
ENV WEBPORT=80
ENV WEBPORT=8080

# https://httpd.apache.org/docs/2.4/stopping.html#gracefulstop
STOPSIGNAL SIGWINCH

# Final touches
EXPOSE 80
EXPOSE ${WEBPORT}
CMD ["bash", "/entrypoint.sh"]

0 comments on commit 0c31f1d

Please sign in to comment.