big / Dockerfile
mfoud444's picture
Add application file
4b3f96e
raw
history blame
No virus
1.37 kB
# Use an official PHP image as the base image
FROM php:7.4-fpm
# Set environment variables
ENV COMPOSER_ALLOW_SUPERUSER=1
# Install system dependencies
RUN apt-get update && apt-get install -y \
libpng-dev \
libjpeg-dev \
libfreetype6-dev \
libzip-dev \
libonig-dev \
libxml2-dev \
libcurl4-openssl-dev \
libicu-dev \
unzip \
git \
zlib1g-dev \
libxslt-dev \
&& docker-php-ext-configure gd --with-freetype --with-jpeg \
&& docker-php-ext-install gd zip pdo pdo_mysql mysqli \
&& pecl install xdebug-3.0.4 \
&& docker-php-ext-enable xdebug \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
# Install Composer
COPY --from=composer:2 /usr/bin/composer /usr/bin/composer
# Set the working directory
WORKDIR /var/www
# Copy application files
COPY . /var/www
# Ensure .env.example exists and create .env if missing
# RUN if [ -f .env.example ]; then cp .env.example .env; else echo ".env.example file not found"; exit 1; fi
RUN ls
# Install Bagisto dependencies
RUN composer install
# Generate application key
RUN php artisan key:generate
# Run Bagisto installation
RUN php artisan bagisto:install
RUN php artisan migrate
RUN php artisan db:seed
RUN php artisan vendor:publish --all
RUN php artisan storage:link
# Expose port 7860
EXPOSE 7860
# Start the PHP-FPM server
CMD ["php-fpm"]