From 233753ca6bda78edc9c032c91c7b879935c32d72 Mon Sep 17 00:00:00 2001 From: Indra Gunawan Date: Mon, 17 Feb 2025 17:31:33 +0800 Subject: [PATCH] docs: update docs for first-time contributor (#1368) --- CONTRIBUTING.md | 9 ++++++--- dev.Dockerfile | 6 ++++-- internal/testserver/main.go | 2 +- 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 0286e5cc..bf5c5ebd 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -11,7 +11,7 @@ docker build -t frankenphp-dev -f dev.Dockerfile . docker run --cap-add=SYS_PTRACE --security-opt seccomp=unconfined -p 8080:8080 -p 443:443 -p 443:443/udp -v $PWD:/go/src/app -it frankenphp-dev ``` -The image contains the usual development tools (Go, GDB, Valgrind, Neovim...). +The image contains the usual development tools (Go, GDB, Valgrind, Neovim...). If docker version is lower than 23.0, build is failed by dockerignore [pattern issue](https://github.com/moby/moby/pull/42676). Add directories to `.dockerignore`. @@ -49,10 +49,13 @@ cd testdata/ ../caddy/frankenphp/frankenphp run ``` -The server is listening on `127.0.0.1:8080`: +The server is listening on `127.0.0.1:80`: + +> [!NOTE] +> if you are using Docker, you will have to either bind container port 80 or execute from inside the container ```console -curl -vk https://localhost/phpinfo.php +curl -vk http://127.0.0.1/phpinfo.php ``` ## Minimal test server diff --git a/dev.Dockerfile b/dev.Dockerfile index 9493e92d..20760a59 100644 --- a/dev.Dockerfile +++ b/dev.Dockerfile @@ -46,7 +46,7 @@ RUN apt-get update && \ echo 'set auto-load safe-path /' > /root/.gdbinit && \ echo '* soft core unlimited' >> /etc/security/limits.conf \ && \ - apt-get clean + apt-get clean WORKDIR /usr/local/src/php RUN git clone --branch=PHP-8.4 https://github.com/php/php-src.git . && \ @@ -71,7 +71,9 @@ WORKDIR /usr/local/src/watcher RUN git clone https://github.com/e-dant/watcher . && \ cmake -S . -B build -DCMAKE_BUILD_TYPE=Release && \ cmake --build build/ && \ - cmake --install build + cmake --install build && \ + cp build/libwatcher-c.so /usr/local/lib/libwatcher-c.so && \ + ldconfig WORKDIR /go/src/app COPY . . diff --git a/internal/testserver/main.go b/internal/testserver/main.go index 29f739f1..e1bd2e9e 100644 --- a/internal/testserver/main.go +++ b/internal/testserver/main.go @@ -21,7 +21,7 @@ func main() { http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) { req, err := frankenphp.NewRequestWithContext(r) - if err == nil { + if err != nil { panic(err) }