dev.Dockerfile 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. # syntax=docker/dockerfile:1
  2. FROM golang:1.22
  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. libbrotli-dev \
  20. libcurl4-openssl-dev \
  21. libonig-dev \
  22. libreadline-dev \
  23. libsodium-dev \
  24. libsqlite3-dev \
  25. libssl-dev \
  26. libxml2-dev \
  27. zlib1g-dev \
  28. bison \
  29. libnss3-tools \
  30. # Dev tools \
  31. git \
  32. clang \
  33. llvm \
  34. gdb \
  35. valgrind \
  36. neovim \
  37. zsh \
  38. libtool-bin && \
  39. echo 'set auto-load safe-path /' > /root/.gdbinit && \
  40. echo '* soft core unlimited' >> /etc/security/limits.conf \
  41. && \
  42. apt-get clean
  43. WORKDIR /usr/local/src/php
  44. RUN git clone --branch=PHP-8.3 https://github.com/php/php-src.git . && \
  45. # --enable-embed is only necessary to generate libphp.so, we don't use this SAPI directly
  46. ./buildconf --force && \
  47. ./configure \
  48. --enable-embed \
  49. --enable-zts \
  50. --disable-zend-signals \
  51. --enable-zend-max-execution-timers \
  52. --enable-debug && \
  53. make -j"$(nproc)" && \
  54. make install && \
  55. ldconfig && \
  56. cp php.ini-development /usr/local/lib/php.ini && \
  57. echo "zend_extension=opcache.so" >> /usr/local/lib/php.ini && \
  58. echo "opcache.enable=1" >> /usr/local/lib/php.ini && \
  59. php --version
  60. WORKDIR /go/src/app
  61. COPY . .
  62. WORKDIR /go/src/app/caddy/frankenphp
  63. RUN go build -buildvcs=false
  64. WORKDIR /go/src/app
  65. CMD [ "zsh" ]