dev.Dockerfile 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. # syntax=docker/dockerfile:1
  2. FROM golang:1.21
  3. ENV CFLAGS="-ggdb3"
  4. ENV PHPIZE_DEPS \
  5. autoconf \
  6. dpkg-dev \
  7. file \
  8. g++ \
  9. gcc \
  10. libc-dev \
  11. make \
  12. pkg-config \
  13. re2c
  14. # hadolint ignore=DL3009
  15. RUN apt-get update && \
  16. apt-get -y --no-install-recommends install \
  17. $PHPIZE_DEPS \
  18. libargon2-dev \
  19. libcurl4-openssl-dev \
  20. libonig-dev \
  21. libreadline-dev \
  22. libsodium-dev \
  23. libsqlite3-dev \
  24. libssl-dev \
  25. libxml2-dev \
  26. zlib1g-dev \
  27. bison \
  28. libnss3-tools \
  29. # Dev tools \
  30. git \
  31. clang \
  32. llvm \
  33. gdb \
  34. valgrind \
  35. neovim \
  36. zsh \
  37. libtool-bin && \
  38. echo 'set auto-load safe-path /' > /root/.gdbinit && \
  39. echo '* soft core unlimited' >> /etc/security/limits.conf \
  40. && \
  41. apt-get clean
  42. WORKDIR /usr/local/src/php
  43. RUN git clone --branch=PHP-8.3 https://github.com/php/php-src.git . && \
  44. # --enable-embed is only necessary to generate libphp.so, we don't use this SAPI directly
  45. ./buildconf --force && \
  46. ./configure \
  47. --enable-embed \
  48. --enable-zts \
  49. --disable-zend-signals \
  50. --enable-zend-max-execution-timers \
  51. --enable-debug && \
  52. make -j"$(nproc)" && \
  53. make install && \
  54. ldconfig && \
  55. cp php.ini-development /usr/local/lib/php.ini && \
  56. echo "zend_extension=opcache.so" >> /usr/local/lib/php.ini && \
  57. echo "opcache.enable=1" >> /usr/local/lib/php.ini && \
  58. php --version
  59. WORKDIR /go/src/app
  60. COPY . .
  61. WORKDIR /go/src/app/caddy/frankenphp
  62. RUN go build
  63. WORKDIR /go/src/app
  64. CMD [ "zsh" ]