dev-alpine.Dockerfile 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. # syntax=docker/dockerfile:1
  2. FROM golang:1.22-alpine
  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. pkgconfig \
  13. re2c
  14. RUN apk add --no-cache \
  15. $PHPIZE_DEPS \
  16. argon2-dev \
  17. brotli-dev \
  18. curl-dev \
  19. oniguruma-dev \
  20. readline-dev \
  21. libsodium-dev \
  22. sqlite-dev \
  23. openssl-dev \
  24. libxml2-dev \
  25. zlib-dev \
  26. bison \
  27. nss-tools \
  28. # Dev tools \
  29. git \
  30. clang \
  31. llvm \
  32. gdb \
  33. valgrind \
  34. neovim \
  35. zsh \
  36. libtool && \
  37. echo 'set auto-load safe-path /' > /root/.gdbinit
  38. WORKDIR /usr/local/src/php
  39. RUN git clone --branch=PHP-8.3 https://github.com/php/php-src.git . && \
  40. # --enable-embed is only necessary to generate libphp.so, we don't use this SAPI directly
  41. ./buildconf --force && \
  42. ./configure \
  43. --enable-embed \
  44. --enable-zts \
  45. --disable-zend-signals \
  46. --enable-zend-max-execution-timers \
  47. --enable-debug && \
  48. make -j"$(nproc)" && \
  49. make install && \
  50. ldconfig /etc/ld.so.conf.d && \
  51. cp php.ini-development /usr/local/lib/php.ini && \
  52. echo "zend_extension=opcache.so" >> /usr/local/lib/php.ini && \
  53. echo "opcache.enable=1" >> /usr/local/lib/php.ini && \
  54. php --version
  55. WORKDIR /go/src/app
  56. COPY . .
  57. WORKDIR /go/src/app/caddy/frankenphp
  58. RUN go build
  59. WORKDIR /go/src/app
  60. CMD [ "zsh" ]