Skip to content

Commit 61b2d0a

Browse files
authored
Merge pull request #36 from zerossB/feature/php-8.1
Add opcache support and New Dockerfile from php 8.1 with supervisor
2 parents ad37995 + 5be8fa2 commit 61b2d0a

File tree

7 files changed

+73
-7
lines changed

7 files changed

+73
-7
lines changed

.github/workflows/docker-image.yml

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,25 @@ jobs:
3636
- name: Push Docker Image Latest
3737
run: docker push anave/php-laravel:latest
3838

39+
build-8-1-supervisor-debian:
40+
name: Build and Push Docker image 8.1-supervisor-debian
41+
runs-on: ubuntu-latest
42+
needs: [ docker-login ]
43+
steps:
44+
- uses: actions/checkout@v3
45+
46+
- name: Docker Hub Login
47+
env:
48+
DOCKER_HUB_LOGIN: ${{secrets.DOCKER_HUB_LOGIN}}
49+
DOCKER_HUB_SECRET: ${{secrets.DOCKER_HUB_SECRET}}
50+
run: docker login -u $DOCKER_HUB_LOGIN -p $DOCKER_HUB_SECRET
51+
52+
- name: Build the Docker Image 8.1-supervisor-debian
53+
run: docker build . --file php/8.1-supervisor-debian/Dockerfile --tag anave/php-laravel:8.1-supervisor-debian
54+
55+
- name: Push Docker Image 8.1-supervisor-debian
56+
run: docker push anave/php-laravel:8.1-supervisor-debian
57+
3958
build-8-1:
4059
name: Build and Push Docker image 8.1
4160
runs-on: ubuntu-latest
@@ -52,7 +71,7 @@ jobs:
5271
- name: Build the Docker Image 8.1
5372
run: docker build . --file php/8.1/Dockerfile --tag anave/php-laravel:8.1
5473

55-
- name: Push Docker Image 8.0
74+
- name: Push Docker Image 8.1
5675
run: docker push anave/php-laravel:8.1
5776

5877
build-8:
@@ -93,7 +112,7 @@ jobs:
93112
- name: Push Docker Image 8.0-supervisor
94113
run: docker push anave/php-laravel:8-supervisor
95114

96-
build-8-supervisor-debian:
115+
uild-8-supervisor-debian:
97116
name: Build and Push Docker image 8.0 with Supervisor on Debian Image
98117
runs-on: ubuntu-latest
99118
needs: [ docker-login ]
@@ -110,7 +129,8 @@ jobs:
110129
run: docker build . --file php/8.0-supervisor-debian/Dockerfile --tag anave/php-laravel:8-supervisor-debian
111130

112131
- name: Push Docker Image 8.0-supervisor-debian
113-
run: docker push anave/php-laravel:8-supervisor-debian
132+
run:
133+
docker push anave/php-laravel:8-supervisor-debianb
114134

115135
build-7:
116136
name: Build and Push Docker image 7.4

php/7.4/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ RUN apk update && apk add --no-cache gcc bash tzdata libpng-dev oniguruma-dev op
99
echo $TZ > /etc/timezone;
1010

1111
# Install PHP extensions
12-
RUN docker-php-ext-install pdo_mysql pdo_sqlite mbstring exif pcntl bcmath gd curl zip intl
12+
RUN docker-php-ext-install pdo_mysql pdo_sqlite mbstring exif pcntl bcmath gd curl zip intl opcache
1313

1414
RUN pecl install xdebug-3.1.4;\
1515
docker-php-ext-enable xdebug

php/8.0-supervisor/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ RUN apk update && apk add --no-cache gcc bash tzdata libpng-dev oniguruma-dev op
99
echo $TZ > /etc/timezone;
1010

1111
# Install PHP extensions
12-
RUN docker-php-ext-install pdo_mysql pdo_sqlite mbstring exif pcntl bcmath gd curl zip intl
12+
RUN docker-php-ext-install pdo_mysql pdo_sqlite mbstring exif pcntl bcmath gd curl zip intl opcache
1313

1414
RUN pecl install xdebug-3.1.4;\
1515
docker-php-ext-enable xdebug

php/8.0/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ RUN apk update && apk add --no-cache gcc bash tzdata libpng-dev oniguruma-dev op
99
echo $TZ > /etc/timezone;
1010

1111
# Install PHP extensions
12-
RUN docker-php-ext-install pdo_mysql pdo_sqlite mbstring exif pcntl bcmath gd curl zip intl
12+
RUN docker-php-ext-install pdo_mysql pdo_sqlite mbstring exif pcntl bcmath gd curl zip intl opcache
1313

1414
RUN pecl install xdebug-3.1.4;\
1515
docker-php-ext-enable xdebug

php/8.1-supervisor-debian/Dockerfile

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
FROM php:8.1-fpm
2+
3+
ENV TZ=UTC
4+
5+
# Install system dependencies
6+
RUN apt-get update && apt-get install -y --no-install-recommends build-essential software-properties-common ca-certificates wget tzdata git curl libpng-dev libonig-dev libxml2-dev zip unzip \
7+
libmariadb-dev sqlite3 libsqlite3-dev g++ libicu-dev libpq-dev libzip-dev zip zlib1g-dev libfreetype6-dev libjpeg62-turbo-dev libpng-dev libcurl4-openssl-dev \
8+
gnupg gnupg2 gnupg1 supervisor nginx cron
9+
10+
RUN cp /usr/share/zoneinfo/$TZ /etc/localtime; \
11+
echo $TZ > /etc/timezone;
12+
13+
# Install PHP extensions
14+
RUN docker-php-ext-install pdo_mysql pdo_sqlite mbstring exif pcntl bcmath gd curl zip intl opcache
15+
16+
RUN pecl install -o -f redis; \
17+
rm -rf /tmp/pear; \
18+
docker-php-ext-enable redis;
19+
20+
# Dockerize Command
21+
ENV DOCKERIZE_VERSION v0.6.1
22+
RUN wget https://github.com/jwilder/dockerize/releases/download/$DOCKERIZE_VERSION/dockerize-alpine-linux-amd64-$DOCKERIZE_VERSION.tar.gz \
23+
&& tar -C /usr/local/bin -xzvf dockerize-alpine-linux-amd64-$DOCKERIZE_VERSION.tar.gz \
24+
&& rm dockerize-alpine-linux-amd64-$DOCKERIZE_VERSION.tar.gz
25+
26+
# Get latest Composer
27+
COPY --from=composer:latest /usr/bin/composer /usr/bin/composer
28+
29+
COPY . /var/www/html
30+
31+
RUN cp ./scripts/entrypoint.sh /usr/local/bin/entry-almobi; \
32+
cp ./scripts/nginx.conf /etc/nginx/sites-available/default; \
33+
cp ./scripts/supervisor.ini /etc/supervisor/supervisord.conf; \
34+
cp ./scripts/opcache.ini /usr/local/etc/php/conf.d/opcache.ini; \
35+
chmod +x /usr/local/bin/entry-almobi;
36+
37+
EXPOSE 8000
38+
EXPOSE 9001
39+
40+
ENTRYPOINT ["entry-almobi"]

php/8.1/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ RUN apk update && apk add --no-cache gcc bash tzdata libpng-dev oniguruma-dev op
99
echo $TZ > /etc/timezone;
1010

1111
# Install PHP extensions
12-
RUN docker-php-ext-install pdo_mysql pdo_sqlite mbstring exif pcntl bcmath gd curl zip intl
12+
RUN docker-php-ext-install pdo_mysql pdo_sqlite mbstring exif pcntl bcmath gd curl zip intl opcache
1313

1414
RUN pecl install xdebug-3.1.4;\
1515
docker-php-ext-enable xdebug

scripts/opcache.ini

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
opcache.enable = 1
2+
opcache.memory_consumption = 512
3+
opcache.interned_strings_buffer = 64
4+
opcache.max_accelerated_files = 30000
5+
opcache.validate_timestamps = 0
6+
opcache.save_comments = 1

0 commit comments

Comments
 (0)