dev-alpine.Dockerfile 1.4 KB

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