From 4c7f4b70d8ae2302df4a5ccfd7f391370c0f30b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tiago=5FGon=C3=A7alves?= <89362354+James-jamames@users.noreply.github.com> Date: Thu, 5 Oct 2023 14:05:55 +0000 Subject: [PATCH] + docker production --- docker/production/Dockerfile | 84 +++++++----------------------------- 1 file changed, 15 insertions(+), 69 deletions(-) diff --git a/docker/production/Dockerfile b/docker/production/Dockerfile index 7b2fd23..3d18342 100644 --- a/docker/production/Dockerfile +++ b/docker/production/Dockerfile @@ -1,15 +1,10 @@ -FROM php:8.2-fpm +FROM registry.lapig.iesa.ufg.br/lapig-images-prod/content-hub:base as python-base ENV URL_TO_APPLICATION_GITHUB="https://github.com/lapig-ufg/content-hub" ENV BRANCH="main" -ENV PKG_CONFIG_PATH=/usr/lib/x86_64-linux-gnu/pkgconfig \ - CURL_CFLAGS=-I/usr/include \ - CURL_LIBS=-L/usr/lib/x86_64-linux-gnu-lcurl \ - LIBXML_CFLAGS=-I/path/to/libxml2/include \ - LIBXML_LIBS=-L/path/to/libxml2/lib-lxml2 \ - COMPOSER_ALLOW_SUPERUSER=1 \ +ENV COMPOSER_ALLOW_SUPERUSER=1 \ APP_ENV=production \ APP_DEBUG=false @@ -18,66 +13,16 @@ USER root WORKDIR /var/www/server -# Install environment dependencies -RUN apt-get update \ - # gd - && apt-get install -y build-essential \ - openssl \ - nginx \ - libfreetype6-dev \ - libjpeg-dev \ - libpng-dev \ - libwebp-dev \ - zlib1g-dev \ - libzip-dev \ - gcc \ - g++ \ - make \ - nano \ - unzip \ - curl \ - git \ - jpegoptim \ - optipng \ - pngquant \ - gifsicle \ - locales \ - libonig-dev \ - libpq-dev \ - libcurl4-openssl-dev \ - libxml2-dev \ - && docker-php-ext-configure gd \ - && docker-php-ext-install gd \ - # gmp - && apt-get install -y --no-install-recommends libgmp-dev libxml2-dev \ - && docker-php-ext-install gmp \ - # pgsql - && docker-php-ext-configure pgsql -with-pgsql=/usr/local/pgsql \ - && docker-php-ext-install pdo pdo_pgsql pgsql mbstring \ - && docker-php-ext-install curl \ - # opcache - && docker-php-ext-enable opcache \ - # exif - && docker-php-ext-install exif \ - && docker-php-ext-install sockets \ - && docker-php-ext-install pcntl \ - && docker-php-ext-install bcmath \ - # zip - && docker-php-ext-install zip \ - && apt-get autoclean -y \ - && rm -rf /var/lib/apt/lists/* \ - && rm -rf /tmp/pear/ - - - -COPY ./deploy/local.ini /usr/local/etc/php/local.ini -COPY ./deploy/conf.d/nginx.conf /etc/nginx/nginx.conf -COPY ./post_deploy.sh /var/www/post_deploy.sh - -# Development config files -COPY ./ssh /root/.ssh + + + +COPY ./docker/production/deploy/local.ini /usr/local/etc/php/local.ini +COPY ./docker/production/deploy/conf.d/nginx.conf /etc/nginx/nginx.conf +COPY ./docker/production/post_deploy.sh /var/www/post_deploy.sh + + COPY ./version.jso* /var/html/version.json -COPY ./.env /var/www/.env + # setup composer and laravel @@ -91,10 +36,11 @@ RUN usermod -u 1000 www-data && \ chown -R www-data:www-data /var/www/server/* && \ chmod -R 775 /var/www/server/storage && \ chmod -R 775 /var/www/server/bootstrap/cache && \ - chown www-data:www-data /var/www/server/bootstrap/cache && \ - chown www-data:www-data /var/www/server/storage && \ + chown -R www-data:www-data /var/www/server/bootstrap/cache && \ + chown -R www-data:www-data /var/www/server/storage && \ + chmod +x /var/www/post_deploy.sh && \ - composer install --optimize-autoloader --no-dev && \ + composer install && \ composer dump-autoload && \ php artisan config:cache && \ php artisan route:cache && \