dev-alpine.Dockerfile 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  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. WORKDIR /usr/local/src/watcher
  64. RUN git clone https://github.com/e-dant/watcher . && \
  65. cmake -S . -B build -DCMAKE_BUILD_TYPE=Release && \
  66. cmake --build build/ && \
  67. cmake --install build
  68. WORKDIR /go/src/app
  69. COPY . .
  70. WORKDIR /go/src/app/caddy/frankenphp
  71. RUN go build
  72. WORKDIR /go/src/app
  73. CMD [ "zsh" ]