Skip to content

Commit

Permalink
feat: 8.4 apache beta
Browse files Browse the repository at this point in the history
  • Loading branch information
varrcan committed Feb 7, 2025
0 parents commit 25b2999
Show file tree
Hide file tree
Showing 8 changed files with 2,191 additions and 0 deletions.
72 changes: 72 additions & 0 deletions .bashrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
# don't put duplicate lines or lines starting with space in the history.
# See bash(1) for more options
HISTCONTROL=ignoreboth

# append to the history file, don't overwrite it
shopt -s histappend

# for setting history length see HISTSIZE and HISTFILESIZE in bash(1)
HISTSIZE=1000
HISTFILESIZE=2000

# check the window size after each command and, if necessary,
# update the values of LINES and COLUMNS.
shopt -s checkwinsize

# set variable identifying the chroot you work in (used in the prompt below)
if [ -z "${debian_chroot:-}" ] && [ -r /etc/debian_chroot ]; then
debian_chroot=$(cat /etc/debian_chroot)
fi

# set a fancy prompt (non-color, unless we know we "want" color)
case "$TERM" in
xterm-color|*-256color) color_prompt=yes;;
esac

if [ -n "$force_color_prompt" ]; then
if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then
color_prompt=yes
else
color_prompt=
fi
fi

if [ "$color_prompt" = yes ]; then
PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
else
PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '
fi
unset color_prompt force_color_prompt

# If this is an xterm set the title to user@host:dir
case "$TERM" in
xterm*|rxvt*)
PS1="\[\e]0;${debian_chroot:+($debian_chroot)}\u@\h: \w\a\]$PS1"
;;
*)
;;
esac

# enable color support of ls and also add handy aliases
if [ -x /usr/bin/dircolors ]; then
test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)"
alias ls='ls --color=auto'
#alias dir='dir --color=auto'
#alias vdir='vdir --color=auto'

alias grep='grep --color=auto'
alias fgrep='fgrep --color=auto'
alias egrep='egrep --color=auto'
fi

alias ..='cd ..'
alias ...='cd ../../../'
alias ....='cd ../../../../'
alias .....='cd ../../../../'
alias .4='cd ../../../../'
alias .5='cd ../../../../..'

# some more ls aliases
alias ll='ls -alF'
alias la='ls -A'
alias l='ls -CF'
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.github
42 changes: 42 additions & 0 deletions .github/workflows/deploy-image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Publish Docker image

on:
push:
tags:
- "*"

env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}

jobs:
build-and-push-image:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Log in to the Container registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract metadata (tags and labels) for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}

- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
72 changes: 72 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
FROM php:8.4-apache

LABEL maintainer="[email protected]"

ENV TZ=Europe/Moscow

ARG COMPOSER_VERSION="2.8.5"
ARG UID=1000
ARG GID=1000

RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone

RUN set -ex && apt-get update && apt-get install -y ssmtp wget git nano libmemcached-dev zlib1g-dev libssl-dev

COPY --from=mlocati/php-extension-installer /usr/bin/install-php-extensions /usr/local/bin/

RUN IPE_GD_WITHOUTAVIF=1 IPE_ICU_EN_ONLY=1 IPE_KEEP_SYSPKG_CACHE=1 install-php-extensions \
bcmath \
exif \
gd \
gmp \
imagick \
intl \
ldap \
mysqli \
opcache \
pcntl \
pdo_mysql \
pdo_pgsql \
pgsql \
soap \
sockets \
xdebug \
zip

RUN IPE_ICU_EN_ONLY=1 IPE_DONT_ENABLE=1 install-php-extensions \
memcache \
memcached \
redis \
xhprof

RUN install-php-extensions @composer-${COMPOSER_VERSION}

RUN groupadd --gid ${GID} ${GID} && \
usermod --non-unique --uid ${UID} www-data && \
usermod --gid ${GID} www-data

RUN mkdir /var/www/.composer && \
mkdir /var/www/.ssh

RUN chown www-data:www-data /var/www -R && \
chown www-data:www-data /usr/local/etc/php/conf.d -R && \
chown www-data:www-data /var/www/.composer && \
chown www-data:www-data /var/www/.ssh

RUN echo 'DocumentRoot ${DOCUMENT_ROOT}' >> /etc/apache2/apache2.conf && \
echo 'ServerName ${HOST_NAME}' > /etc/apache2/conf-enabled/default.conf && \
echo 'ServerSignature Off' > /etc/apache2/conf-enabled/z-security.conf && \
echo 'ServerTokens Minimal' >> /etc/apache2/conf-enabled/z-security.conf && \
rm /etc/apache2/sites-enabled/000-default.conf

RUN a2enmod rewrite

COPY php.ini /usr/local/etc/php
COPY ssmtp.conf /etc/ssmtp/
COPY .bashrc /var/www/
COPY docker-entrypoint.sh /entrypoint.sh

WORKDIR /var/www
USER www-data:www-data

ENTRYPOINT ["/entrypoint.sh"]
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# php8.4-apache

```bash
docker pull quay.io/local-deploy/php8.4-apache
# or
docker pull ghcr.io/local-deploy/php8.4-apache
```
15 changes: 15 additions & 0 deletions docker-entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/bash
set -e

if [ "$PHP_MODULES" != "" ]; then
for module in $PHP_MODULES; do
docker-php-ext-enable "$module"
done
fi

# Run
if [[ -n "$1" ]]; then
exec "${*}"
else
exec apache2-foreground
fi
Loading

0 comments on commit 25b2999

Please sign in to comment.