-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d44fdf4
commit 0aaac9e
Showing
27 changed files
with
408 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,123 @@ | ||
name: Docker build for slim variant | ||
on: | ||
push: | ||
branches: | ||
- 8.3 | ||
schedule: | ||
- cron: '0 0 1 * *' | ||
workflow_dispatch: | ||
|
||
jobs: | ||
build-cli: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- | ||
name: Checkout | ||
uses: actions/checkout@v4 | ||
- | ||
name: Set up QEMU | ||
uses: docker/setup-qemu-action@v3 | ||
- | ||
name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
- | ||
name: Login to GitHub Container Registry | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ secrets.GHCR_USR }} | ||
password: ${{ secrets.GHCR_PAT }} | ||
- | ||
name: Build and push | ||
uses: docker/build-push-action@v6 | ||
with: | ||
context: slim/cli/ | ||
platforms: linux/amd64,linux/arm64 | ||
push: true | ||
tags: ghcr.io/digital-entropy/dokar-php/cli:8.3-slim | ||
|
||
build-fpm: | ||
needs: build-cli | ||
runs-on: ubuntu-latest | ||
steps: | ||
- | ||
name: Checkout | ||
uses: actions/checkout@v4 | ||
- | ||
name: Set up QEMU | ||
uses: docker/setup-qemu-action@v3 | ||
- | ||
name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
- | ||
name: Login to GitHub Container Registry | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ secrets.GHCR_USR }} | ||
password: ${{ secrets.GHCR_PAT }} | ||
- | ||
name: Build and push | ||
uses: docker/build-push-action@v6 | ||
with: | ||
context: ubuntu/fpm/ | ||
platforms: linux/amd64,linux/arm64 | ||
push: true | ||
tags: ghcr.io/digital-entropy/dokar-php/fpm:8.3-slim | ||
|
||
build-octane: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- | ||
name: Checkout | ||
uses: actions/checkout@v4 | ||
- | ||
name: Set up QEMU | ||
uses: docker/setup-qemu-action@v3 | ||
- | ||
name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
- | ||
name: Login to GitHub Container Registry | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ secrets.GHCR_USR }} | ||
password: ${{ secrets.GHCR_PAT }} | ||
- | ||
name: Build and push | ||
uses: docker/build-push-action@v6 | ||
with: | ||
context: ubuntu/octane/ | ||
platforms: linux/amd64,linux/arm64 | ||
push: true | ||
tags: ghcr.io/digital-entropy/dokar-php/octane:8.3-slim | ||
|
||
build-nginx: | ||
needs: build-fpm | ||
runs-on: ubuntu-latest | ||
steps: | ||
- | ||
name: Checkout | ||
uses: actions/checkout@v4 | ||
- | ||
name: Set up QEMU | ||
uses: docker/setup-qemu-action@v3 | ||
- | ||
name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
- | ||
name: Login to GitHub Container Registry | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ secrets.GHCR_USR }} | ||
password: ${{ secrets.GHCR_PAT }} | ||
- | ||
name: Build and push | ||
uses: docker/build-push-action@v6 | ||
with: | ||
context: ubuntu/nginx/ | ||
platforms: linux/amd64,linux/arm64 | ||
push: true | ||
tags: ghcr.io/digital-entropy/dokar-php/nginx:8.3-slim |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
FROM alpine:3 | ||
|
||
LABEL org.opencontainers.image.source=https://github.com/digital-entropy/dokar-php | ||
LABEL org.opencontainers.image.branch=8.3 | ||
|
||
ENV TERM=linux | ||
|
||
ENV TZ=UTC | ||
|
||
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone | ||
|
||
RUN apk update \ | ||
&& apk add --repository=https://dl-cdn.alpinelinux.org/alpine/edge/testing gosu \ | ||
&& apk add bash curl ca-certificates zip unzip git sqlite libcap libpng-dev \ | ||
php83 php83-dev php83-gd php83-curl php83-soap \ | ||
php83-sqlite3 php83-pgsql php83-mysqli \ | ||
php83-mbstring php83-xml php83-zip php83-bcmath \ | ||
php83-intl php83-ldap php83-pecl-igbinary php83-pecl-redis \ | ||
composer \ | ||
&& apk cache clean \ | ||
&& rm -rf /var/cache/apk/* /tmp/* /var/tmp/* | ||
|
||
RUN composer global require --quiet --no-ansi laravel/envoy \ | ||
&& composer clear-cache --quiet \ | ||
&& ln -s /root/.composer/vendor/laravel/envoy/bin/envoy /usr/bin/envoy | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
FROM ghcr.io/digital-entropy/dokar-php/cli:8.3-slim | ||
|
||
LABEL org.opencontainers.image.source=https://github.com/digital-entropy/dokar-php | ||
LABEL org.opencontainers.image.branch=8.3 | ||
|
||
# Install FPM | ||
RUN apk update \ | ||
&& apk add php83-fpm \ | ||
&& apk cache clean \ | ||
&& rm -rf /var/cache/apk/* /tmp/* /var/tmp/* | ||
|
||
# PHP-FPM packages need a nudge to make them docker-friendly | ||
COPY overrides.conf /etc/php/8.3/fpm/pool.d/z-overrides.conf | ||
|
||
# PHP-FPM has really dirty logs, certainly not good for dockerising | ||
# The following startup script contains some magic to clean these up | ||
COPY php-fpm-startup /usr/bin/php-fpm | ||
CMD /usr/bin/php-fpm |
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
FROM ghcr.io/digital-entropy/dokar-php/fpm:8.3-slim | ||
|
||
LABEL org.opencontainers.image.source=https://github.com/digital-entropy/dokar-php | ||
LABEL org.opencontainers.image.branch=8.3 | ||
|
||
RUN apk update \ | ||
&& apk add nginx supervisor \ | ||
&& apk cache clean \ | ||
&& rm -rf /var/cache/apk/* /tmp/* /var/tmp/* \ | ||
&& rm /etc/nginx/http.d/* | ||
|
||
RUN mkdir -p /var/www/public | ||
|
||
COPY index.php /var/www/public | ||
|
||
WORKDIR /var/www | ||
|
||
COPY site.conf /etc/nginx/http.d/site.conf | ||
|
||
COPY supervisor /etc/supervisor | ||
|
||
# Add a non-root user to prevent files being created with root permissions on host machine. | ||
ONBUILD ARG USER_CONTAINER=dokar | ||
ONBUILD ENV USER_CONTAINER=${USER_CONTAINER} | ||
ONBUILD ARG PUID=1000 | ||
ONBUILD ENV PUID=${PUID} | ||
ONBUILD ARG PGID=1000 | ||
ONBUILD ENV PGID=${PGID} | ||
|
||
ONBUILD RUN if [ "${PGID}" != "0" ] && [ "${PUID}" != "0" ]; then \ | ||
(grep -q ":${PGID}:" /etc/group && old_group=$(getent group ${PGID} | cut -d: -f1) && delgroup ${old_group} \ | ||
|| addgroup -g ${PGID} ${USER_CONTAINER}) \ | ||
&& (grep -q ":${PUID}:" /etc/passwd && old_user=$(getent passwd ${PUID} | cut -d: -f1) && deluser --remove-home ${old_user} \ | ||
|| adduser -h /home/${USER_CONTAINER} -G ${USER_CONTAINER} -u ${PUID} ${USER_CONTAINER} -D) \ | ||
fi | ||
|
||
EXPOSE 80 | ||
|
||
STOPSIGNAL SIGTERM | ||
|
||
CMD ["/usr/bin/supervisord", "-n", "-c", "/etc/supervisor/supervisord.conf"] |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
FROM alpine:3 | ||
|
||
LABEL org.opencontainers.image.source=https://github.com/digital-entropy/dokar-php | ||
LABEL org.opencontainers.image.branch=8.3 | ||
|
||
ENV TERM=linux | ||
|
||
ENV TZ=UTC | ||
|
||
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone | ||
|
||
RUN apk update \ | ||
&& apk add --repository=https://dl-cdn.alpinelinux.org/alpine/edge/testing gosu \ | ||
&& apk add bash curl ca-certificates zip unzip git sqlite libcap libpng-dev \ | ||
php83 php83-dev php83-gd php83-curl php83-soap \ | ||
php83-sqlite3 php83-pgsql php83-mysqli \ | ||
php83-mbstring php83-xml php83-zip php83-bcmath \ | ||
php83-intl php83-ldap \ | ||
php83-pecl-igbinary php83-pecl-redis php83-pecl-swoole | ||
|
||
RUN apk add composer \ | ||
&& composer global require --quiet --no-ansi laravel/envoy \ | ||
&& composer clear-cache --quiet \ | ||
&& ln -s /root/.composer/vendor/laravel/envoy/bin/envoy /usr/bin/envoy | ||
|
||
RUN apk add nodejs npm \ | ||
&& npm install -g chokidar pnpm | ||
|
||
RUN apk cache clean \ | ||
&& rm -rf /var/cache/apk/* /tmp/* /var/tmp/* | ||
|
||
COPY runner.sh /runner.sh | ||
|
||
# Add a non-root user to prevent files being created with root permissions on host machine. | ||
ONBUILD ARG USER_CONTAINER=dokar | ||
ONBUILD ENV USER_CONTAINER=${USER_CONTAINER} | ||
ONBUILD ARG PUID=1000 | ||
ONBUILD ENV PUID=${PUID} | ||
ONBUILD ARG PGID=1000 | ||
ONBUILD ENV PGID=${PGID} | ||
|
||
# Convert to alpine | ||
ONBUILD RUN if [ "${PGID}" != "0" ] && [ "${PUID}" != "0" ]; then \ | ||
(grep -q ":${PGID}:" /etc/group && old_group=$(getent group ${PGID} | cut -d: -f1) && delgroup ${old_group} \ | ||
|| addgroup -g ${PGID} ${USER_CONTAINER}) \ | ||
&& (grep -q ":${PUID}:" /etc/passwd && old_user=$(getent passwd ${PUID} | cut -d: -f1) && deluser --remove-home ${old_user} \ | ||
|| adduser -h /home/${USER_CONTAINER} -G ${USER_CONTAINER} -u ${PUID} ${USER_CONTAINER} -D) \ | ||
fi | ||
|
||
EXPOSE 80 | ||
|
||
WORKDIR /var/www | ||
|
||
ARG DOCKER_ENV=production | ||
ENV DOCKER_ENV=${DOCKER_ENV} | ||
ENV DOCKER_WORKERS=auto | ||
|
||
CMD ["/runner.sh"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -Eeo pipefail | ||
set -o errexit # Used to exit upon error, avoiding cascading errors | ||
|
||
IFS=$'\n\t' | ||
|
||
cd /var/www | ||
|
||
if [ -d vendor ]; then | ||
echo "vendor ok!" | ||
else | ||
composer install | ||
fi | ||
|
||
echo "run on '$DOCKER_ENV' environment!" | ||
echo "run with '$DOCKER_WORKERS' workers!" | ||
|
||
if [ $DOCKER_ENV == "production" ]; then | ||
php artisan octane:start --host=0.0.0.0 --port=80 --workers=$DOCKER_WORKERS --task-workers=$DOCKER_WORKERS | ||
else | ||
if [ -d node_modules ]; then | ||
echo "node_modules ok!" | ||
else | ||
npm install | ||
fi | ||
|
||
php artisan octane:start --host=0.0.0.0 --watch --port=80 --workers=$DOCKER_WORKERS --task-workers=$DOCKER_WORKERS | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.