#stage 0
FROM php:7.2-fpm-alpine

WORKDIR /var/www/html/trucking

# Install system dependencies
RUN apk --update add \
    curl \
	openssl \
    libpng-dev \
    libxml2-dev \
	libzip-dev \
    curl-dev \
    oniguruma-dev

# Clear cache
RUN apk del gcc g++
RUN rm -rf /var/cache/apk/*

# Install PHP extensions
RUN docker-php-ext-install bcmath curl gd exif mbstring mysqli pdo pdo_mysql pcntl xml zip

# Get latest Composer
COPY --from=composer:latest /usr/bin/composer /usr/bin/composer

COPY ./ /var/www/html/trucking

RUN composer install \
    --ignore-platform-reqs \
    --no-interaction \
    --no-plugins \
    --no-scripts \
    --prefer-dist

RUN chmod -R 777 storage/logs/ && chmod -R 777 storage/framework/

RUN cp -R vendor /vendor

# BELOM SUPPORT KIRIM EMAIL