static-builder.Dockerfile 2.2 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. 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-curl \
  51. php83-dom \
  52. php83-mbstring \
  53. php83-openssl \
  54. php83-pcntl \
  55. php83-phar \
  56. php83-posix \
  57. php83-sodium \
  58. php83-tokenizer \
  59. php83-xml \
  60. php83-xmlwriter; \
  61. ln -sf /usr/bin/php83 /usr/bin/php
  62. # https://getcomposer.org/doc/03-cli.md#composer-allow-superuser
  63. ENV COMPOSER_ALLOW_SUPERUSER=1
  64. ENV PATH="${PATH}:/root/.composer/vendor/bin"
  65. COPY --from=composer/composer:2-bin --link /composer /usr/bin/composer
  66. WORKDIR /go/src/app
  67. COPY go.mod go.sum ./
  68. RUN go mod graph | awk '{if ($1 !~ "@") print $2}' | xargs go get
  69. WORKDIR /go/src/app/caddy
  70. COPY caddy/go.mod caddy/go.sum ./
  71. RUN go mod graph | awk '{if ($1 !~ "@") print $2}' | xargs go get
  72. WORKDIR /go/src/app
  73. COPY *.* ./
  74. COPY caddy caddy
  75. COPY C-Thread-Pool C-Thread-Pool
  76. RUN --mount=type=secret,id=github-token GITHUB_TOKEN=$(cat /run/secrets/github-token) ./build-static.sh