Skip to content

Commit ff2f07c

Browse files
committed
feat: add php 8.3 container
1 parent 3a0af4a commit ff2f07c

3 files changed

Lines changed: 146 additions & 1 deletion

File tree

.github/workflows/build-containers.yaml

Lines changed: 38 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,4 +189,41 @@ jobs:
189189
file: php-8.2/dev.Dockerfile
190190
platforms: linux/amd64,linux/arm64
191191
push: true
192-
tags: defrostedtuna/php-nginx:8.2-dev
192+
tags: defrostedtuna/php-nginx:8.2-dev
193+
194+
build-php-83:
195+
name: PHP 8.3
196+
runs-on: ubuntu-latest
197+
steps:
198+
- name: Checkout Code
199+
uses: actions/checkout@v2
200+
201+
- name: Set up QEMU
202+
uses: docker/setup-qemu-action@v1
203+
204+
- name: Set up Docker Buildx
205+
uses: docker/setup-buildx-action@v1
206+
207+
- name: Login to DockerHub
208+
uses: docker/login-action@v1
209+
with:
210+
username: ${{ secrets.DOCKER_USERNAME }}
211+
password: ${{ secrets.DOCKER_PASSWORD }}
212+
213+
- name: Build Production Container
214+
uses: docker/build-push-action@v2
215+
with:
216+
context: .
217+
file: php-8.3/Dockerfile
218+
platforms: linux/amd64,linux/arm64
219+
push: true
220+
tags: defrostedtuna/php-nginx:8.3
221+
222+
- name: Build Development Container
223+
uses: docker/build-push-action@v2
224+
with:
225+
context: .
226+
file: php-8.3/dev.Dockerfile
227+
platforms: linux/amd64,linux/arm64
228+
push: true
229+
tags: defrostedtuna/php-nginx:8.3-dev

php-8.3/Dockerfile

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
FROM alpine:3.21
2+
LABEL Maintainer="Rick Bennett <rbennett1106@gmail.com>"
3+
4+
# Essentials
5+
RUN echo "UTC" > /etc/timezone
6+
RUN apk add --no-cache zip unzip curl python3 supervisor
7+
8+
# PHP Configuration (8.3.17-r0)
9+
RUN apk add --no-cache \
10+
php83 \
11+
php83-bcmath \
12+
php83-ctype \
13+
php83-curl \
14+
php83-dom \
15+
php83-fileinfo \
16+
php83-fpm \
17+
php83-json \
18+
php83-mbstring \
19+
php83-opcache \
20+
php83-openssl \
21+
php83-pdo_mysql \
22+
php83-phar \
23+
php83-session \
24+
php83-simplexml \
25+
php83-tokenizer \
26+
php83-xml \
27+
php83-xmlwriter \
28+
php83-zip
29+
30+
# Nginx Configuration (1.26.2-r4)
31+
RUN apk add --no-cache nginx
32+
33+
# Setup the user and group permissions
34+
RUN adduser -D -g 'www' www
35+
36+
# Link php83 to php
37+
RUN ln -sf php83 /usr/bin/php && \
38+
ln -sf /usr/sbin/php-fpm83 /usr/bin/php-fpm && \
39+
ln -sf /etc/php83 /etc/php && \
40+
ln -sf /usr/bin/python3 /usr/bin/python
41+
42+
# Bootstrap directories
43+
RUN mkdir -p /app && \
44+
mkdir -p /var/tmp/nginx && \
45+
mkdir -p /var/tmp/nginx/client_body && \
46+
mkdir -p /var/log/supervisord
47+
48+
# Bootstrap files
49+
RUN touch /var/run/php-fpm.pid && \
50+
touch /var/run/nginx.pid && \
51+
touch /var/run/supervisord.pid
52+
53+
# Copy configs (PHP)
54+
COPY configs/php/php.ini /etc/php/php.ini
55+
COPY configs/php/php-fpm.conf /etc/php/php-fpm.conf
56+
COPY configs/php/php-fpm.d/www.conf /etc/php/php-fpm.d/www.conf
57+
58+
# Copy configs (Nginx)
59+
COPY configs/nginx/nginx.conf /etc/nginx/nginx.conf
60+
COPY configs/nginx/conf.d/default.conf /etc/nginx/conf.d/default.conf
61+
62+
# Copy configs (Supervisor)
63+
COPY configs/supervisord/supervisord.conf /etc/supervisord/supervisord.conf
64+
65+
# Copy scripts
66+
COPY scripts/install_composer.sh /root
67+
68+
# Copy entrypoint script
69+
COPY scripts/entrypoint.sh /sbin/entrypoint.sh
70+
71+
# Change ownership
72+
RUN chown -R www:www /app && \
73+
chown -R www:www /var/run/php-fpm.pid && \
74+
chown -R www:www /var/run/nginx.pid && \
75+
chown -R www:www /var/run/supervisord.pid && \
76+
chown -R www:www /var/lib/nginx && \
77+
chown -R www:www /var/tmp/nginx && \
78+
chown -R www:www /var/log/supervisord
79+
80+
# Change permissions
81+
RUN chmod -R 755 /root/install_composer.sh && \
82+
chmod -R 770 /var/tmp/nginx && \
83+
chmod -R 770 /var/tmp/nginx/client_body && \
84+
chmod -R 755 /sbin/entrypoint.sh
85+
86+
# Install Composer
87+
ENV PATH="/root/.composer/vendor/bin:${PATH}"
88+
RUN cd /root && ./install_composer.sh 2.8.5
89+
90+
WORKDIR /app
91+
92+
EXPOSE 80
93+
CMD ["/sbin/entrypoint.sh"]

php-8.3/dev.Dockerfile

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
FROM defrostedtuna/php-nginx:8.3
2+
3+
# Add sqlite and xdebug for development purposes.
4+
RUN apk add --no-cache \
5+
php82-pdo_sqlite \
6+
php82-sqlite3 \
7+
php82-xdebug
8+
9+
# Increase the PHP memory limit for development.
10+
RUN echo $'\nmemory_limit = 1G' >> /etc/php/php.ini
11+
12+
# Enable the xdebug extension.
13+
# `/etc/php` has been symlinked to `/etc/php{version}` on the parent container for ease of use.
14+
RUN echo zend_extension=xdebug.so >> /etc/php/conf.d/xdebug.ini
15+
ENV XDEBUG_MODE=coverage

0 commit comments

Comments
 (0)