File size: 1,367 Bytes
1eb5b68
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3eaa850
1eb5b68
 
 
 
 
 
 
 
 
 
a6b52f0
1eb5b68
 
a6b52f0
04c85f6
a0f59f2
4b3f96e
a6b52f0
 
1eb5b68
 
 
 
 
 
 
 
 
 
 
3eaa850
 
a6b52f0
 
1eb5b68
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
# 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"]