Skip to content

Commit

Permalink
+ docker production
Browse files Browse the repository at this point in the history
  • Loading branch information
James-jamames committed Oct 5, 2023
1 parent 6d0ff41 commit 4c7f4b7
Showing 1 changed file with 15 additions and 69 deletions.
84 changes: 15 additions & 69 deletions docker/production/Dockerfile
Original file line number Diff line number Diff line change
@@ -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

Expand All @@ -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
Expand All @@ -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 && \
Expand Down

0 comments on commit 4c7f4b7

Please sign in to comment.