Compare commits

..

No commits in common. "main" and "3.20.7" have entirely different histories.
main ... 3.20.7

5 changed files with 5 additions and 169 deletions

View file

@ -1,107 +0,0 @@
name: docker-build
on:
push:
branches:
- main
permissions: write-all
jobs:
release:
runs-on: docker
outputs:
version: ${{ steps.version.outputs.version }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Define next tag
uses: https://github.com/paulhatch/semantic-version@v5.0.2
id: version
with:
tag_prefix: ""
major_pattern: "(MAJOR)"
minor_pattern: "(MINOR)"
change_path: .
version_format: "${major}.${minor}.${patch}"
- name: Create tag
run: |
git config --global user.name "${GITHUB_ACTOR}"
git config --global user.email "${GITHUB_ACTOR}@users.noreply.github.com"
git tag "${{ steps.version.outputs.version }}" -m "[forgejo-action-tag]"
git push origin --tags
webserver:
env:
REPO_NAME: alpine-php8-webserver
needs:
- release
outputs:
version: ${{ needs.release.outputs.version }}
runs-on: host
steps:
- name: Checkout Repository
uses: actions/checkout@v4
with:
github-server-url: https://git.h2-invent.com
repository: Public-System-Design/${{ env.REPO_NAME }}
ref: main
path: ${{ env.REPO_NAME }}
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
registry: git.h2-invent.com
username: ${{ secrets.FORGEJO_ACTION_PACKAGE_RW_USER }}
password: ${{ secrets.FORGEJO_ACTION_PACKAGE_RW_KEY }}
- name: Build and push Docker image
uses: docker/build-push-action@v6
with:
context: ./${{ env.REPO_NAME }}
push: true
tags: |
git.h2-invent.com/public-system-design/${{ env.REPO_NAME }}:${{ needs.release.outputs.version }}
git.h2-invent.com/public-system-design/${{ env.REPO_NAME }}:latest
build-args: |
VERSION=${{ needs.release.outputs.version }}
cron:
env:
REPO_NAME: alpine-php8-cron-webserver
needs:
- webserver
runs-on: host
steps:
- name: Checkout Repository
uses: actions/checkout@v4
with:
github-server-url: https://git.h2-invent.com
repository: Public-System-Design/${{ env.REPO_NAME }}
ref: main
path: ${{ env.REPO_NAME }}
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
registry: git.h2-invent.com
username: ${{ secrets.FORGEJO_ACTION_PACKAGE_RW_USER }}
password: ${{ secrets.FORGEJO_ACTION_PACKAGE_RW_KEY }}
- name: Build and push Docker image
uses: docker/build-push-action@v6
with:
context: ./${{ env.REPO_NAME }}
push: true
tags: |
git.h2-invent.com/public-system-design/${{ env.REPO_NAME }}:${{ needs.webserver.outputs.version }}
git.h2-invent.com/public-system-design/${{ env.REPO_NAME }}:latest
build-args: |
VERSION=${{ needs.webserver.outputs.version }}

View file

@ -1,40 +0,0 @@
name: Build and Push Image
description: Builds and pushes a Docker image.
inputs:
repo_name:
description: "Name of the repo (also used as build context path)"
required: true
version:
description: "Version tag"
required: true
jobs:
build:
runs-on: host
steps:
- name: Checkout Repository
uses: actions/checkout@v4
with:
github-server-url: https://git.h2-invent.com
repository: Public-System-Design/${{ inputs.repo_name }}
ref: main
path: ${{ inputs.repo_name }}
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
registry: git.h2-invent.com
username: ${{ secrets.FORGEJO_ACTION_PACKAGE_RW_USER }}
password: ${{ secrets.FORGEJO_ACTION_PACKAGE_RW_KEY }}
- name: Build and push Docker image
uses: docker/build-push-action@v6
with:
context: ./${{ inputs.repo_name }}
push: true
tags: |
git.h2-invent.com/public-system-design/${{ inputs.repo_name }}:${{ inputs.version }}
git.h2-invent.com/public-system-design/${{ inputs.repo_name }}:latest
build-args: |
VERSION=${{ inputs.version }}

View file

@ -87,14 +87,8 @@ ENTRYPOINT ["/bin/docker-entrypoint.sh"]
HEALTHCHECK --timeout=10s CMD curl --silent --fail http://127.0.0.1:8080/fpm-ping || exit 1 HEALTHCHECK --timeout=10s CMD curl --silent --fail http://127.0.0.1:8080/fpm-ping || exit 1
ENV nginx_root_directory=/var/www/html/public \ ENV nginx_root_directory=/var/www/html/public \
nginx_fastcgi_read_timeout=100 \
client_max_body_size=2M \ client_max_body_size=2M \
clear_env=no \ clear_env=no \
pm_mode=dynamic \
pm_start_servers=20 \
pm_min_spare_servers=10 \
pm_max_spare_servers=20 \
pm_max_requests=1000 \
allow_url_fopen=On \ allow_url_fopen=On \
allow_url_include=Off \ allow_url_include=Off \
display_errors=Off \ display_errors=Off \

View file

@ -57,7 +57,9 @@ http {
index index.php index.html; index index.php index.html;
location / { location / {
try_files $uri /index.php$is_args$args; # First attempt to serve request as file, then
# as directory, then fall back to index.php
try_files $uri $uri/ /index.php?q=$uri&$args;
} }
# Redirect server error pages to the static page /50x.html # Redirect server error pages to the static page /50x.html
@ -66,14 +68,6 @@ http {
root /var/lib/nginx/html; root /var/lib/nginx/html;
} }
location ^~ /theme/ {
alias /var/www/html/public/theme/;
add_header 'Access-Control-Allow-Origin' '*' always;
expires 30d;
access_log off;
try_files $uri =404;
}
# Pass the PHP scripts to PHP-FPM listening on socket # Pass the PHP scripts to PHP-FPM listening on socket
location ~ [^/]\.php(/|$) { location ~ [^/]\.php(/|$) {
fastcgi_split_path_info ^(.+\.php)(/.+)$; fastcgi_split_path_info ^(.+\.php)(/.+)$;
@ -82,8 +76,6 @@ http {
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param SCRIPT_NAME $fastcgi_script_name; fastcgi_param SCRIPT_NAME $fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info; fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_index index.php;
fastcgi_read_timeout ${nginx_fastcgi_read_timeout};
include fastcgi_params; include fastcgi_params;
# Pass the original forwarded_scheme and HTTPS status to the PHP backend # Pass the original forwarded_scheme and HTTPS status to the PHP backend

View file

@ -34,7 +34,7 @@ listen.group = nobody
pm.status_path = /fpm-status pm.status_path = /fpm-status
; Ondemand process manager ; Ondemand process manager
pm = $pm_mode pm = ondemand
; The number of child processes to be created when pm is set to 'static' and the ; The number of child processes to be created when pm is set to 'static' and the
; maximum number of child processes when pm is set to 'dynamic' or 'ondemand'. ; maximum number of child processes when pm is set to 'dynamic' or 'ondemand'.
@ -46,9 +46,6 @@ pm = $pm_mode
; Note: Used when pm is set to 'static', 'dynamic' or 'ondemand' ; Note: Used when pm is set to 'static', 'dynamic' or 'ondemand'
; Note: This value is mandatory. ; Note: This value is mandatory.
pm.max_children = 100 pm.max_children = 100
pm.start_servers = $pm_start_servers
pm.min_spare_servers = $pm_min_spare_servers
pm.max_spare_servers = $pm_max_spare_servers
; The number of seconds after which an idle process will be killed. ; The number of seconds after which an idle process will be killed.
; Note: Used only when pm is set to 'ondemand' ; Note: Used only when pm is set to 'ondemand'
@ -59,7 +56,7 @@ pm.process_idle_timeout = 10s;
; This can be useful to work around memory leaks in 3rd party libraries. For ; This can be useful to work around memory leaks in 3rd party libraries. For
; endless request processing specify '0'. Equivalent to PHP_FCGI_MAX_REQUESTS. ; endless request processing specify '0'. Equivalent to PHP_FCGI_MAX_REQUESTS.
; Default Value: 0 ; Default Value: 0
pm.max_requests = $pm_max_requests pm.max_requests = 1000
; Make sure the FPM workers can reach the environment variables for configuration ; Make sure the FPM workers can reach the environment variables for configuration
clear_env = $clear_env clear_env = $clear_env