This commit is contained in:
hackerESQ
2025-01-25 18:09:02 -06:00
parent 8dd153fb53
commit 16d5b80657
5 changed files with 35 additions and 42 deletions
+22 -11
View File
@@ -6,40 +6,51 @@ ENV DEBIAN_FRONTEND=noninteractive
COPY . /var/www/app
WORKDIR /var/www/app
# Install Composer and Node.js
RUN apt-get update && apt-get install -y \
curl \
unzip \
git \
nodejs \
npm \
&& curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
# Install PHP dependencies
RUN composer install --no-scripts --optimize-autoloader
# Install Node dependencies and build assets
RUN npm install && npm run build
# Set permissions
RUN chown -R www-data:www-data . \
&& chmod -R 775 ./storage \
&& chmod +x ./docker/entrypoint.sh \
# Install common php extension dependencies
&& apt-get update && apt-get install -y \
nginx \
libfreetype-dev \
libjpeg62-turbo-dev \
libpng-dev \
zlib1g-dev \
libzip-dev \
unzip \
libicu-dev \
git \
curl \
supervisor \
&& docker-php-ext-configure gd --with-freetype --with-jpeg \
&& docker-php-ext-configure zip \
&& docker-php-ext-install -j$(nproc) \
gd \
zip \
pdo_mysql \
mysqli \
intl \
# Install Node.js and npm
&& curl -fsSL https://deb.nodesource.com/setup_20.x | bash - \
&& apt-get install -y nodejs \
&& npm install -g npm@latest
# remove default nginx config
&& rm /etc/nginx/sites-enabled/default
# Copy the custom Nginx configuration
COPY ./docker/nginx.conf /etc/nginx/conf.d/default.conf
# Copy over supervisor configuration
COPY ./docker/supervisord.conf /etc/supervisor/conf.d/supervisord.conf
# Install composer
COPY --from=composer:2.6.5 /usr/bin/composer /usr/local/bin/composer
# Serve on port 80
EXPOSE 80