static-builder.Dockerfile 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  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. composer \
  30. curl \
  31. file \
  32. flex \
  33. g++ \
  34. gcc \
  35. git \
  36. jq \
  37. libgcc \
  38. libstdc++ \
  39. libtool \
  40. linux-headers \
  41. m4 \
  42. make \
  43. pkgconfig \
  44. php83 \
  45. php83-common \
  46. php83-ctype \
  47. php83-curl \
  48. php83-dom \
  49. php83-mbstring \
  50. php83-openssl \
  51. php83-pcntl \
  52. php83-phar \
  53. php83-posix \
  54. php83-session \
  55. php83-sodium \
  56. php83-tokenizer \
  57. php83-xml \
  58. php83-xmlwriter \
  59. upx \
  60. wget \
  61. xz ; \
  62. ln -sf /usr/bin/php83 /usr/bin/php
  63. # https://getcomposer.org/doc/03-cli.md#composer-allow-superuser
  64. ENV COMPOSER_ALLOW_SUPERUSER=1
  65. WORKDIR /go/src/app
  66. COPY go.mod go.sum ./
  67. RUN go mod graph | awk '{if ($1 !~ "@") print $2}' | xargs go get
  68. WORKDIR /go/src/app/caddy
  69. COPY caddy/go.mod caddy/go.sum ./
  70. RUN go mod graph | awk '{if ($1 !~ "@") print $2}' | xargs go get
  71. WORKDIR /go/src/app
  72. COPY *.* ./
  73. COPY caddy caddy
  74. COPY C-Thread-Pool C-Thread-Pool
  75. RUN --mount=type=secret,id=github-token GITHUB_TOKEN=$(cat /run/secrets/github-token) ./build-static.sh