dev.Dockerfile 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. # syntax=docker/dockerfile:1
  2. #checkov:skip=CKV_DOCKER_2
  3. #checkov:skip=CKV_DOCKER_3
  4. FROM golang:1.22
  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. pkg-config \
  15. re2c"
  16. SHELL ["/bin/bash", "-o", "pipefail", "-c"]
  17. # hadolint ignore=DL3009
  18. RUN apt-get update && \
  19. apt-get -y --no-install-recommends install \
  20. $PHPIZE_DEPS \
  21. libargon2-dev \
  22. libbrotli-dev \
  23. libcurl4-openssl-dev \
  24. libonig-dev \
  25. libreadline-dev \
  26. libsodium-dev \
  27. libsqlite3-dev \
  28. libssl-dev \
  29. libxml2-dev \
  30. zlib1g-dev \
  31. bison \
  32. libnss3-tools \
  33. # Dev tools \
  34. git \
  35. clang \
  36. cmake \
  37. llvm \
  38. gdb \
  39. valgrind \
  40. neovim \
  41. zsh \
  42. libtool-bin && \
  43. echo 'set auto-load safe-path /' > /root/.gdbinit && \
  44. echo '* soft core unlimited' >> /etc/security/limits.conf \
  45. && \
  46. apt-get clean
  47. WORKDIR /usr/local/src/php
  48. RUN git clone --branch=PHP-8.3 https://github.com/php/php-src.git . && \
  49. # --enable-embed is only necessary to generate libphp.so, we don't use this SAPI directly
  50. ./buildconf --force && \
  51. ./configure \
  52. --enable-embed \
  53. --enable-zts \
  54. --disable-zend-signals \
  55. --enable-zend-max-execution-timers \
  56. --enable-debug && \
  57. make -j"$(nproc)" && \
  58. make install && \
  59. ldconfig && \
  60. cp php.ini-development /usr/local/lib/php.ini && \
  61. echo "zend_extension=opcache.so" >> /usr/local/lib/php.ini && \
  62. echo "opcache.enable=1" >> /usr/local/lib/php.ini && \
  63. php --version
  64. # Install e-dant/watcher (necessary for file watching)
  65. ARG EDANT_WATCHER_VERSION=release
  66. WORKDIR /usr/local/src/watcher
  67. RUN git clone --branch=$EDANT_WATCHER_VERSION https://github.com/e-dant/watcher . && \
  68. cmake -S . -B build -DCMAKE_BUILD_TYPE=Release && \
  69. cmake --build build/ && \
  70. cmake --install build
  71. WORKDIR /go/src/app
  72. COPY . .
  73. WORKDIR /go/src/app/caddy/frankenphp
  74. RUN go build -buildvcs=false -tags 'nobadger,nomysql,nopgx'
  75. WORKDIR /go/src/app
  76. CMD [ "zsh" ]