static-builder.Dockerfile 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. # syntax=docker/dockerfile:1
  2. FROM golang-base
  3. ARG FRANKENPHP_VERSION=''
  4. ENV FRANKENPHP_VERSION=${FRANKENPHP_VERSION}
  5. ARG PHP_VERSION=''
  6. ENV PHP_VERSION=${PHP_VERSION}
  7. ARG PHP_EXTENSIONS=''
  8. ARG PHP_EXTENSION_LIBS=''
  9. ARG CLEAN=''
  10. ARG EMBED=''
  11. ARG DEBUG_SYMBOLS=''
  12. ARG MIMALLOC=''
  13. ARG NO_COMPRESS=''
  14. SHELL ["/bin/ash", "-eo", "pipefail", "-c"]
  15. LABEL org.opencontainers.image.title=FrankenPHP
  16. LABEL org.opencontainers.image.description="The modern PHP app server"
  17. LABEL org.opencontainers.image.url=https://frankenphp.dev
  18. LABEL org.opencontainers.image.source=https://github.com/dunglas/frankenphp
  19. LABEL org.opencontainers.image.licenses=MIT
  20. LABEL org.opencontainers.image.vendor="Kévin Dunglas"
  21. RUN apk update; \
  22. apk add --no-cache \
  23. alpine-sdk \
  24. autoconf \
  25. automake \
  26. bash \
  27. binutils \
  28. bison \
  29. build-base \
  30. cmake \
  31. curl \
  32. file \
  33. flex \
  34. g++ \
  35. gcc \
  36. git \
  37. jq \
  38. libgcc \
  39. libstdc++ \
  40. libtool \
  41. linux-headers \
  42. m4 \
  43. make \
  44. pkgconfig \
  45. php83 \
  46. php83-common \
  47. php83-ctype \
  48. php83-curl \
  49. php83-dom \
  50. php83-mbstring \
  51. php83-openssl \
  52. php83-pcntl \
  53. php83-phar \
  54. php83-posix \
  55. php83-session \
  56. php83-sodium \
  57. php83-tokenizer \
  58. php83-xml \
  59. php83-xmlwriter \
  60. upx \
  61. wget \
  62. xz ; \
  63. ln -sf /usr/bin/php83 /usr/bin/php
  64. # https://getcomposer.org/doc/03-cli.md#composer-allow-superuser
  65. ENV COMPOSER_ALLOW_SUPERUSER=1
  66. COPY --from=composer/composer:2-bin /composer /usr/bin/composer
  67. WORKDIR /go/src/app
  68. COPY go.mod go.sum ./
  69. RUN go mod graph | awk '{if ($1 !~ "@") print $2}' | xargs go get
  70. WORKDIR /go/src/app/caddy
  71. COPY caddy/go.mod caddy/go.sum ./
  72. RUN go mod graph | awk '{if ($1 !~ "@") print $2}' | xargs go get
  73. WORKDIR /go/src/app
  74. COPY *.* ./
  75. COPY caddy caddy
  76. COPY C-Thread-Pool C-Thread-Pool
  77. RUN --mount=type=secret,id=github-token GITHUB_TOKEN=$(cat /run/secrets/github-token) ./build-static.sh && \
  78. rm -Rf dist/static-php-cli/source/*