static-builder.Dockerfile 1.7 KB

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