static-builder.Dockerfile 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  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. ENV PHP_EXTENSIONS=${PHP_EXTENSIONS}
  9. ARG PHP_EXTENSION_LIBS=''
  10. ENV PHP_EXTENSION_LIBS=${PHP_EXTENSION_LIBS}
  11. ARG CLEAN=''
  12. ARG EMBED=''
  13. SHELL ["/bin/ash", "-eo", "pipefail", "-c"]
  14. LABEL org.opencontainers.image.title=FrankenPHP
  15. LABEL org.opencontainers.image.description="The modern PHP app server"
  16. LABEL org.opencontainers.image.url=https://frankenphp.dev
  17. LABEL org.opencontainers.image.source=https://github.com/dunglas/frankenphp
  18. LABEL org.opencontainers.image.licenses=MIT
  19. LABEL org.opencontainers.image.vendor="Kévin Dunglas"
  20. RUN apk update; \
  21. apk add --no-cache \
  22. autoconf \
  23. automake \
  24. bash \
  25. binutils \
  26. bison \
  27. build-base \
  28. cmake \
  29. curl \
  30. file \
  31. flex \
  32. g++ \
  33. gcc \
  34. git \
  35. jq \
  36. libgcc \
  37. libstdc++ \
  38. libtool \
  39. linux-headers \
  40. m4 \
  41. make \
  42. pkgconfig \
  43. wget \
  44. xz ; \
  45. apk add --no-cache \
  46. --repository=https://dl-cdn.alpinelinux.org/alpine/edge/main \
  47. --repository=https://dl-cdn.alpinelinux.org/alpine/edge/community \
  48. php83 \
  49. php83-common \
  50. php83-ctype \
  51. php83-curl \
  52. php83-dom \
  53. php83-mbstring \
  54. php83-openssl \
  55. php83-pcntl \
  56. php83-phar \
  57. php83-posix \
  58. php83-session \
  59. php83-sodium \
  60. php83-tokenizer \
  61. php83-xml \
  62. php83-xmlwriter; \
  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. ENV PATH="${PATH}:/root/.composer/vendor/bin"
  67. COPY --from=composer/composer:2-bin --link /composer /usr/bin/composer
  68. WORKDIR /go/src/app
  69. COPY go.mod go.sum ./
  70. RUN go mod graph | awk '{if ($1 !~ "@") print $2}' | xargs go get
  71. WORKDIR /go/src/app/caddy
  72. COPY caddy/go.mod caddy/go.sum ./
  73. RUN go mod graph | awk '{if ($1 !~ "@") print $2}' | xargs go get
  74. WORKDIR /go/src/app
  75. COPY *.* ./
  76. COPY caddy caddy
  77. COPY C-Thread-Pool C-Thread-Pool
  78. RUN --mount=type=secret,id=github-token GITHUB_TOKEN=$(cat /run/secrets/github-token) ./build-static.sh