-
Notifications
You must be signed in to change notification settings - Fork 110
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
299 additions
and
254 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,11 @@ | ||
# Accepted values: 8.3 - 8.2 | ||
ARG PHP_VERSION=8.3 | ||
|
||
ARG FRANKENPHP_VERSION=latest | ||
|
||
ARG COMPOSER_VERSION=latest | ||
|
||
########################################### | ||
# Build frontend assets with Bun | ||
########################################### | ||
|
||
ARG FRANKENPHP_VERSION=1.3.6 | ||
ARG COMPOSER_VERSION=2.8 | ||
ARG BUN_VERSION="latest" | ||
|
||
FROM oven/bun:${BUN_VERSION} AS build | ||
|
||
ENV ROOT=/var/www/html | ||
|
||
WORKDIR ${ROOT} | ||
|
||
COPY --link package.json bun.lockb* ./ | ||
|
||
RUN bun install --frozen-lockfile | ||
|
||
COPY --link . . | ||
|
||
RUN bun run build | ||
|
||
########################################### | ||
|
||
FROM composer:${COMPOSER_VERSION} AS vendor | ||
|
||
FROM dunglas/frankenphp:${FRANKENPHP_VERSION}-php${PHP_VERSION}-alpine | ||
FROM dunglas/frankenphp:${FRANKENPHP_VERSION}-php${PHP_VERSION}-alpine AS base | ||
|
||
LABEL maintainer="SMortexa <[email protected]>" | ||
LABEL org.opencontainers.image.title="Laravel Octane Dockerfile" | ||
|
@@ -43,9 +19,8 @@ ARG TZ=UTC | |
ARG APP_DIR=/var/www/html | ||
|
||
ENV TERM=xterm-color \ | ||
WITH_HORIZON=false \ | ||
WITH_SCHEDULER=false \ | ||
OCTANE_SERVER=frankenphp \ | ||
TZ=${TZ} \ | ||
USER=octane \ | ||
ROOT=${APP_DIR} \ | ||
COMPOSER_FUND=0 \ | ||
|
@@ -72,6 +47,7 @@ RUN apk update; \ | |
ca-certificates \ | ||
supervisor \ | ||
libsodium-dev \ | ||
brotli \ | ||
# Install PHP extensions (included with dunglas/frankenphp) | ||
&& install-php-extensions \ | ||
bz2 \ | ||
|
@@ -122,6 +98,22 @@ RUN cp ${PHP_INI_DIR}/php.ini-production ${PHP_INI_DIR}/php.ini | |
USER ${USER} | ||
|
||
COPY --link --chown=${WWWUSER}:${WWWUSER} --from=vendor /usr/bin/composer /usr/bin/composer | ||
|
||
COPY --link --chown=${WWWUSER}:${WWWUSER} deployment/supervisord.conf /etc/supervisor/ | ||
COPY --link --chown=${WWWUSER}:${WWWUSER} deployment/octane/FrankenPHP/supervisord.frankenphp.conf /etc/supervisor/conf.d/ | ||
COPY --link --chown=${WWWUSER}:${WWWUSER} deployment/supervisord.*.conf /etc/supervisor/conf.d/ | ||
COPY --link --chown=${WWWUSER}:${WWWUSER} deployment/start-container /usr/local/bin/start-container | ||
COPY --link --chown=${WWWUSER}:${WWWUSER} deployment/healthcheck /usr/local/bin/healthcheck | ||
COPY --link --chown=${WWWUSER}:${WWWUSER} deployment/php.ini ${PHP_INI_DIR}/conf.d/99-octane.ini | ||
|
||
RUN chmod +x /usr/local/bin/start-container /usr/local/bin/healthcheck | ||
|
||
########################################### | ||
|
||
FROM base AS common | ||
|
||
USER ${USER} | ||
|
||
COPY --link --chown=${WWWUSER}:${WWWUSER} composer.json composer.lock ./ | ||
|
||
RUN composer install \ | ||
|
@@ -132,6 +124,34 @@ RUN composer install \ | |
--no-scripts \ | ||
--audit | ||
|
||
########################################### | ||
# Build frontend assets with Bun | ||
########################################### | ||
|
||
FROM oven/bun:${BUN_VERSION} AS build | ||
|
||
ENV ROOT=/var/www/html | ||
|
||
WORKDIR ${ROOT} | ||
|
||
COPY --link package.json bun.lock* ./ | ||
|
||
RUN bun install --frozen-lockfile | ||
|
||
COPY --link . . | ||
COPY --link --from=common ${ROOT}/vendor vendor | ||
|
||
RUN bun run build | ||
|
||
########################################### | ||
|
||
FROM common AS runner | ||
|
||
USER ${USER} | ||
|
||
ENV WITH_HORIZON=false \ | ||
WITH_SCHEDULER=false | ||
|
||
COPY --link --chown=${WWWUSER}:${WWWUSER} . . | ||
COPY --link --chown=${WWWUSER}:${WWWUSER} --from=build ${ROOT}/public public | ||
|
||
|
@@ -143,32 +163,18 @@ RUN mkdir -p \ | |
storage/logs \ | ||
bootstrap/cache && chmod -R a+rw storage | ||
|
||
COPY --link --chown=${WWWUSER}:${WWWUSER} deployment/supervisord.conf /etc/supervisor/ | ||
COPY --link --chown=${WWWUSER}:${WWWUSER} deployment/octane/FrankenPHP/supervisord.frankenphp.conf /etc/supervisor/conf.d/ | ||
COPY --link --chown=${WWWUSER}:${WWWUSER} deployment/supervisord.*.conf /etc/supervisor/conf.d/ | ||
COPY --link --chown=${WWWUSER}:${WWWUSER} deployment/start-container /usr/local/bin/start-container | ||
COPY --link --chown=${WWWUSER}:${WWWUSER} deployment/healthcheck /usr/local/bin/healthcheck | ||
COPY --link --chown=${WWWUSER}:${WWWUSER} deployment/php.ini ${PHP_INI_DIR}/conf.d/99-octane.ini | ||
|
||
# FrankenPHP embedded PHP configuration | ||
COPY --link --chown=${WWWUSER}:${WWWUSER} deployment/php.ini /lib/php.ini | ||
|
||
RUN composer install \ | ||
--classmap-authoritative \ | ||
--no-interaction \ | ||
--no-ansi \ | ||
--no-dev \ | ||
&& composer clear-cache | ||
|
||
RUN chmod +x /usr/local/bin/start-container /usr/local/bin/healthcheck | ||
|
||
RUN cat deployment/utilities.sh >> ~/.bashrc | ||
|
||
EXPOSE 8000 | ||
EXPOSE 443 | ||
EXPOSE 443/udp | ||
EXPOSE 2019 | ||
|
||
ENTRYPOINT ["start-container"] | ||
|
||
HEALTHCHECK --start-period=5s --interval=2s --timeout=5s --retries=8 CMD healthcheck || exit 1 | ||
HEALTHCHECK --start-period=5s --interval=2s --timeout=5s --retries=8 CMD healthcheck || exit 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,11 @@ | ||
# Accepted values: 8.3 - 8.2 | ||
ARG PHP_VERSION=8.3 | ||
|
||
ARG FRANKENPHP_VERSION=latest | ||
|
||
ARG COMPOSER_VERSION=latest | ||
|
||
########################################### | ||
# Build frontend assets with Bun | ||
########################################### | ||
|
||
ARG FRANKENPHP_VERSION=1.3.6 | ||
ARG COMPOSER_VERSION=2.8 | ||
ARG BUN_VERSION="latest" | ||
|
||
FROM oven/bun:${BUN_VERSION} AS build | ||
|
||
ENV ROOT=/var/www/html | ||
|
||
WORKDIR ${ROOT} | ||
|
||
COPY --link package.json bun.lockb* ./ | ||
|
||
RUN bun install --frozen-lockfile | ||
|
||
COPY --link . . | ||
|
||
RUN bun run build | ||
|
||
########################################### | ||
|
||
FROM composer:${COMPOSER_VERSION} AS vendor | ||
|
||
FROM dunglas/frankenphp:${FRANKENPHP_VERSION}-php${PHP_VERSION} | ||
FROM dunglas/frankenphp:${FRANKENPHP_VERSION}-php${PHP_VERSION} AS base | ||
|
||
LABEL maintainer="SMortexa <[email protected]>" | ||
LABEL org.opencontainers.image.title="Laravel Octane Dockerfile" | ||
|
@@ -44,9 +20,8 @@ ARG APP_DIR=/var/www/html | |
|
||
ENV DEBIAN_FRONTEND=noninteractive \ | ||
TERM=xterm-color \ | ||
WITH_HORIZON=false \ | ||
WITH_SCHEDULER=false \ | ||
OCTANE_SERVER=frankenphp \ | ||
TZ=${TZ} \ | ||
USER=octane \ | ||
ROOT=${APP_DIR} \ | ||
COMPOSER_FUND=0 \ | ||
|
@@ -74,6 +49,7 @@ RUN apt-get update; \ | |
ca-certificates \ | ||
supervisor \ | ||
libsodium-dev \ | ||
brotli \ | ||
# Install PHP extensions (included with dunglas/frankenphp) | ||
&& install-php-extensions \ | ||
bz2 \ | ||
|
@@ -126,6 +102,22 @@ RUN cp ${PHP_INI_DIR}/php.ini-production ${PHP_INI_DIR}/php.ini | |
USER ${USER} | ||
|
||
COPY --link --chown=${WWWUSER}:${WWWUSER} --from=vendor /usr/bin/composer /usr/bin/composer | ||
|
||
COPY --link --chown=${WWWUSER}:${WWWUSER} deployment/supervisord.conf /etc/supervisor/ | ||
COPY --link --chown=${WWWUSER}:${WWWUSER} deployment/octane/FrankenPHP/supervisord.frankenphp.conf /etc/supervisor/conf.d/ | ||
COPY --link --chown=${WWWUSER}:${WWWUSER} deployment/supervisord.*.conf /etc/supervisor/conf.d/ | ||
COPY --link --chown=${WWWUSER}:${WWWUSER} deployment/start-container /usr/local/bin/start-container | ||
COPY --link --chown=${WWWUSER}:${WWWUSER} deployment/healthcheck /usr/local/bin/healthcheck | ||
COPY --link --chown=${WWWUSER}:${WWWUSER} deployment/php.ini ${PHP_INI_DIR}/conf.d/99-octane.ini | ||
|
||
RUN chmod +x /usr/local/bin/start-container /usr/local/bin/healthcheck | ||
|
||
########################################### | ||
|
||
FROM base AS common | ||
|
||
USER ${USER} | ||
|
||
COPY --link --chown=${WWWUSER}:${WWWUSER} composer.json composer.lock ./ | ||
|
||
RUN composer install \ | ||
|
@@ -136,6 +128,34 @@ RUN composer install \ | |
--no-scripts \ | ||
--audit | ||
|
||
########################################### | ||
# Build frontend assets with Bun | ||
########################################### | ||
|
||
FROM oven/bun:${BUN_VERSION} AS build | ||
|
||
ENV ROOT=/var/www/html | ||
|
||
WORKDIR ${ROOT} | ||
|
||
COPY --link package.json bun.lock* ./ | ||
|
||
RUN bun install --frozen-lockfile | ||
|
||
COPY --link . . | ||
COPY --link --from=common ${ROOT}/vendor vendor | ||
|
||
RUN bun run build | ||
|
||
########################################### | ||
|
||
FROM common AS runner | ||
|
||
USER ${USER} | ||
|
||
ENV WITH_HORIZON=false \ | ||
WITH_SCHEDULER=false | ||
|
||
COPY --link --chown=${WWWUSER}:${WWWUSER} . . | ||
COPY --link --chown=${WWWUSER}:${WWWUSER} --from=build ${ROOT}/public public | ||
|
||
|
@@ -144,32 +164,18 @@ RUN mkdir -p \ | |
storage/logs \ | ||
bootstrap/cache && chmod -R a+rw storage | ||
|
||
COPY --link --chown=${WWWUSER}:${WWWUSER} deployment/supervisord.conf /etc/supervisor/ | ||
COPY --link --chown=${WWWUSER}:${WWWUSER} deployment/octane/FrankenPHP/supervisord.frankenphp.conf /etc/supervisor/conf.d/ | ||
COPY --link --chown=${WWWUSER}:${WWWUSER} deployment/supervisord.*.conf /etc/supervisor/conf.d/ | ||
COPY --link --chown=${WWWUSER}:${WWWUSER} deployment/start-container /usr/local/bin/start-container | ||
COPY --link --chown=${WWWUSER}:${WWWUSER} deployment/healthcheck /usr/local/bin/healthcheck | ||
COPY --link --chown=${WWWUSER}:${WWWUSER} deployment/php.ini ${PHP_INI_DIR}/conf.d/99-octane.ini | ||
|
||
# FrankenPHP embedded PHP configuration | ||
COPY --link --chown=${WWWUSER}:${WWWUSER} deployment/php.ini /lib/php.ini | ||
|
||
RUN composer install \ | ||
--classmap-authoritative \ | ||
--no-interaction \ | ||
--no-ansi \ | ||
--no-dev \ | ||
&& composer clear-cache | ||
|
||
RUN chmod +x /usr/local/bin/start-container /usr/local/bin/healthcheck | ||
|
||
RUN cat deployment/utilities.sh >> ~/.bashrc | ||
|
||
EXPOSE 8000 | ||
EXPOSE 443 | ||
EXPOSE 443/udp | ||
EXPOSE 2019 | ||
|
||
ENTRYPOINT ["start-container"] | ||
|
||
HEALTHCHECK --start-period=5s --interval=2s --timeout=5s --retries=8 CMD healthcheck || exit 1 | ||
HEALTHCHECK --start-period=5s --interval=2s --timeout=5s --retries=8 CMD healthcheck || exit 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.