wip: binary build

This commit is contained in:
Ronald A. Richardson
2024-04-03 15:15:27 +08:00
parent 013e19f39e
commit ff59941947

View File

@@ -1,9 +1,9 @@
FROM --platform=linux/amd64 dunglas/frankenphp:static-builder FROM --platform=linux/amd64 dunglas/frankenphp:static-builder
# Install packages # # Install packages
RUN apt-get update && apt-get install -y git bind9-utils mycli nodejs npm \ # RUN apt-get update && apt-get install -y git bind9-utils mycli nodejs npm \
&& mkdir -p /root/.ssh \ # && mkdir -p /root/.ssh \
&& ssh-keyscan github.com >> /root/.ssh/known_hosts # && ssh-keyscan github.com >> /root/.ssh/known_hosts
# Set some build ENV variables # Set some build ENV variables
ENV LOG_CHANNEL=stdout ENV LOG_CHANNEL=stdout
@@ -18,28 +18,28 @@ ARG ENVIRONMENT=production
ENV APP_ENV=$ENVIRONMENT ENV APP_ENV=$ENVIRONMENT
# Copy Caddyfile # Copy Caddyfile
COPY --chown=www-data:www-data ./Caddyfile $CADDYFILE_PATH COPY ./Caddyfile $CADDYFILE_PATH
# Create /fleetbase directory and set correct permissions # Create /fleetbase directory and set correct permissions
RUN mkdir -p /fleetbase/api && chown -R www-data:www-data /fleetbase RUN mkdir -p /fleetbase && mkdir -p /fleetbase/api && mkdir -p /fleetbase/console
# Set working directory # Set working directory
WORKDIR /fleetbase/api WORKDIR /fleetbase/api
# Setup api # Setup api
COPY --chown=www-data:www-data ./api /fleetbase/api COPY ./api /fleetbase/api
# Setup console # Setup console
COPY --chown=www-data:www-data ./console /fleetbase/console COPY ./console /fleetbase/console
# Set permissions for deploy script # Set permissions for deploy script
RUN chmod +x /fleetbase/api/deploy.sh RUN chmod +x /fleetbase/api/deploy.sh
# Pre-install Composer dependencies # Pre-install Composer dependencies
RUN su www-data -s /bin/sh -c "composer install --no-scripts --optimize-autoloader --no-dev" # RUN /bin/sh -c "composer install --no-scripts --optimize-autoloader --no-dev"
# Dump autoload # Dump autoload
RUN su www-data -s /bin/sh -c "composer dumpautoload" # RUN /bin/sh -c "composer dumpautoload"
# Build binary # Build binary
RUN EMBED=/ \ RUN EMBED=/ \