Untitled

 avatar
user_3839718
dockerfile
a year ago
1.4 kB
1
Indexable
Never
FROM composer:1.10.19 AS composer

WORKDIR /app/

COPY composer.json ./

RUN apk add icu-dev
RUN docker-php-ext-install mysqli pdo pdo_mysql
RUN docker-php-ext-configure intl && docker-php-ext-install intl
RUN docker-php-ext-install sockets

RUN composer update --lock --no-dev
RUN composer install --no-dev

FROM php:7.4-fpm

# Install system dependencies
RUN apt-get update && apt-get install -y \
    libicu-dev \
    libzip-dev \
    zip \
    unzip \
    git \
    wget \
    awscli

# Install PHP extensions
RUN docker-php-ext-configure intl
RUN docker-php-ext-install intl zip bcmath sockets mysqli pdo pdo_mysql

# Install Python 3
RUN apt-get update && apt-get install -y python3-pip
# Install pandas, numpy, and mysql-connector
RUN pip3 install pandas numpy mysql-connector==2.2.9

# Set the working directory
WORKDIR /apps/chickenboy-site

# Copy application files from the composer stage
COPY --from=composer /app/vendor /apps/chickenboy-site/vendor/
COPY . .

# Permissions
RUN chmod -R 777 /apps/chickenboy-site
RUN chmod -R 777 /apps/chickenboy-site/data

# Copy PHP configurations
COPY provisioning/php/chickenboy.ini /usr/local/etc/php/conf.d/chickenboy.ini

# Configure AWS CLI
COPY provisioning/aws/config /root/.aws/config
COPY provisioning/aws/credentials /root/.aws/credentials

ARG DEPLOY_TO
COPY provisioning/php/${DEPLOY_TO}.php /apps/chickenboy-site/config/autoload/local.php

EXPOSE 80 8080 443