big / Dockerfile
mfoud444's picture
Add application file
a0f59f2
raw
history blame
No virus
1.31 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 \
libmcrypt-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 \
&& 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 the Bagisto application
COPY . /var/www
RUN composer create-project bagisto/bagisto
# Install Bagisto dependencies
RUN composer install
# Configure environment
COPY .env.example .env
# 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 9000
EXPOSE 9000
# Start the PHP-FPM server
CMD ["php-fpm"]