-
Notifications
You must be signed in to change notification settings - Fork 0
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
ed4944a
commit 64836e4
Showing
4 changed files
with
66 additions
and
0 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,36 @@ | ||
name: Build and Push Docker Image to GHCR | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
|
||
jobs: | ||
build-and-push: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
packages: write | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Login to GitHub Container Registry | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Build PHP | ||
run: docker buildx build -f Dockerfile.php -t ghcr.io/${{ github.actor }}/cro-php-example:php . | ||
|
||
- name: Build Nginx | ||
run: docker buildx build -f Dockerfile.nginx -t ghcr.io/${{ github.actor }}/cro-php-example:nginx . | ||
|
||
- name: Push PHP | ||
run: docker push ghcr.io/${{ github.actor }}/cro-php-example:php | ||
|
||
- name: Push Nginx | ||
run: docker push ghcr.io/${{ github.actor }}/cro-php-example:nginx |
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,5 @@ | ||
FROM nginx | ||
WORKDIR /app | ||
COPY index.php . | ||
COPY nginx-site.conf /etc/nginx/conf.d/default.conf | ||
EXPOSE 80 |
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,3 @@ | ||
FROM php:8.3-fpm | ||
WORKDIR /var/www/html | ||
COPY /index.php . |
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,22 @@ | ||
server { | ||
server_name _; | ||
listen [::]:80; | ||
listen 80; | ||
|
||
root /app; | ||
|
||
location / { | ||
try_files $uri /index.php$is_args$args; | ||
} | ||
|
||
location ~ .php$ { | ||
fastcgi_split_path_info ^(.+\.php)(/.+)$; | ||
fastcgi_pass 127.0.0.1:9000; | ||
fastcgi_index index.php; | ||
include fastcgi_params; | ||
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; | ||
fastcgi_param PATH_INFO $fastcgi_path_info; | ||
fastcgi_param DOCUMENT_ROOT $realpath_root; | ||
fastcgi_intercept_errors on; | ||
} | ||
} |