dev-alpine.Dockerfile 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. # syntax=docker/dockerfile:1
  2. #checkov:skip=CKV_DOCKER_2
  3. #checkov:skip=CKV_DOCKER_3
  4. FROM golang:1.22-alpine
  5. ENV CFLAGS="-ggdb3"
  6. ENV PHPIZE_DEPS="\
  7. autoconf \
  8. dpkg-dev \
  9. file \
  10. g++ \
  11. gcc \
  12. libc-dev \
  13. make \
  14. pkgconfig \
  15. re2c"
  16. SHELL ["/bin/ash", "-eo", "pipefail", "-c"]
  17. RUN apk add --no-cache \
  18. $PHPIZE_DEPS \
  19. argon2-dev \
  20. brotli-dev \
  21. curl-dev \
  22. oniguruma-dev \
  23. readline-dev \
  24. libsodium-dev \
  25. sqlite-dev \
  26. openssl-dev \
  27. libxml2-dev \
  28. zlib-dev \
  29. bison \
  30. nss-tools \
  31. # file watcher
  32. libstdc++ \
  33. linux-headers \
  34. # Dev tools \
  35. git \
  36. clang \
  37. cmake \
  38. llvm \
  39. gdb \
  40. valgrind \
  41. neovim \
  42. zsh \
  43. libtool && \
  44. echo 'set auto-load safe-path /' > /root/.gdbinit
  45. WORKDIR /usr/local/src/php
  46. RUN git clone --branch=PHP-8.4 https://github.com/php/php-src.git . && \
  47. # --enable-embed is only necessary to generate libphp.so, we don't use this SAPI directly
  48. ./buildconf --force && \
  49. ./configure \
  50. --enable-embed \
  51. --enable-zts \
  52. --disable-zend-signals \
  53. --enable-zend-max-execution-timers \
  54. --enable-debug && \
  55. make -j"$(nproc)" && \
  56. make install && \
  57. ldconfig /etc/ld.so.conf.d && \
  58. cp php.ini-development /usr/local/lib/php.ini && \
  59. echo "zend_extension=opcache.so" >> /usr/local/lib/php.ini && \
  60. echo "opcache.enable=1" >> /usr/local/lib/php.ini && \
  61. php --version
  62. # Install e-dant/watcher (necessary for file watching)
  63. ARG EDANT_WATCHER_VERSION=release
  64. WORKDIR /usr/local/src/watcher
  65. RUN git clone --branch=$EDANT_WATCHER_VERSION https://github.com/e-dant/watcher . && \
  66. cmake -S . -B build -DCMAKE_BUILD_TYPE=Release && \
  67. cmake --build build/ && \
  68. cmake --install build
  69. WORKDIR /go/src/app
  70. COPY . .
  71. WORKDIR /go/src/app/caddy/frankenphp
  72. RUN go build
  73. WORKDIR /go/src/app
  74. CMD [ "zsh" ]