tambah trust proxy
This commit is contained in:
@@ -14,7 +14,7 @@ RUN apt-get update && apt-get install -y \
|
||||
&& docker-php-ext-install pdo_mysql gd intl zip \
|
||||
&& pecl install redis \
|
||||
&& docker-php-ext-enable redis \
|
||||
&& a2enmod rewrite headers \
|
||||
&& a2enmod rewrite headers proxy proxy_http \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
COPY --from=composer:2 /usr/bin/composer /usr/bin/composer
|
||||
|
||||
@@ -2,6 +2,12 @@
|
||||
ServerAdmin webmaster@localhost
|
||||
DocumentRoot /var/www/html/public
|
||||
|
||||
# ── Webhook deploy (Gitea) — proxy ke container webhook ───────────────────
|
||||
# https://myansuran.mbip.my/hooks/myansuran-deploy → myansuran-webhook:9000
|
||||
ProxyPreserveHost On
|
||||
ProxyPass /hooks/ http://myansuran-webhook:9000/hooks/
|
||||
ProxyPassReverse /hooks/ http://myansuran-webhook:9000/hooks/
|
||||
|
||||
<Directory /var/www/html/public>
|
||||
AllowOverride All
|
||||
Require all granted
|
||||
|
||||
8
docker/webhook/Dockerfile
Normal file
8
docker/webhook/Dockerfile
Normal file
@@ -0,0 +1,8 @@
|
||||
FROM golang:1.23-alpine AS builder
|
||||
RUN go install github.com/adnanh/webhook@2.8.1
|
||||
|
||||
FROM alpine:3.21
|
||||
RUN apk add --no-cache git openssh-client docker-cli
|
||||
COPY --from=builder /go/bin/webhook /usr/local/bin/webhook
|
||||
EXPOSE 9000
|
||||
ENTRYPOINT ["/usr/local/bin/webhook"]
|
||||
32
docker/webhook/hooks.json
Normal file
32
docker/webhook/hooks.json
Normal file
@@ -0,0 +1,32 @@
|
||||
[
|
||||
{
|
||||
"id": "myansuran-deploy",
|
||||
"execute-command": "/deploy.sh",
|
||||
"command-working-directory": "/srv/myansuran",
|
||||
"response-message": "Deploy myAnsuran dimulakan.",
|
||||
"trigger-rule": {
|
||||
"and": [
|
||||
{
|
||||
"match": {
|
||||
"type": "payload-hmac-sha256",
|
||||
"secret": "{{ getenv "WEBHOOK_SECRET" }}",
|
||||
"parameter": {
|
||||
"source": "header",
|
||||
"name": "X-Gitea-Signature"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"match": {
|
||||
"type": "value",
|
||||
"value": "refs/heads/master",
|
||||
"parameter": {
|
||||
"source": "payload",
|
||||
"name": "ref"
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
Reference in New Issue
Block a user