Skip to content

Commit

Permalink
Alpine 3.11 and PHP 7.4
Browse files Browse the repository at this point in the history
  • Loading branch information
mmuniraju4444 committed Apr 28, 2020
1 parent eac269d commit 68a3c6d
Show file tree
Hide file tree
Showing 7 changed files with 76 additions and 63 deletions.
2 changes: 1 addition & 1 deletion .env.example
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
############# CONTAINER VERSIONS ############
PHP_VER=7.3.6
PHP_VER=7.4.5
REDIS_VER=5.0.5
NGINX_VER=stable
MARIADB_VER=10.4.5
Expand Down
22 changes: 4 additions & 18 deletions Nginx/conf/app.conf
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
server {
listen 80;
server_name rentapp.local;
root /var/www/html/RentApp/public;
server_name blog.local;
root /var/www/html/blog/public;
index index.php;
location / {
try_files $uri $uri/ /index.php?$query_string;
Expand All @@ -19,7 +19,7 @@ server {

server {
listen 80;
server_name database.rentapp.local;
server_name database.blog.local;
location / {
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-NginX-Proxy true;
Expand All @@ -36,24 +36,10 @@ server {

server {
listen 80;
server_name supervisor.rentapp.local;
server_name supervisor.blog.local;
location / {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $http_host;
proxy_pass http://supervisor:9001;
}
}

server {
listen 80;
server_name new.rentapp.local;
location / {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $http_host;
proxy_pass http://workspace:3000;
}

location /api {
proxy_pass http://rentapp.local/api;
}
}
31 changes: 18 additions & 13 deletions Php-fpm/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,35 +1,40 @@
ARG CONTAINER_VERSION=${CONTAINER_VERSION}
FROM php:${CONTAINER_VERSION}-fpm-alpine

#RUN echo "https://mirror.csclub.uwaterloo.ca/alpine/v3.9/main" > /etc/apk/repositories && \
# echo "https://mirror.csclub.uwaterloo.ca/alpine/v3.9/community" >> /etc/apk/repositories

RUN apk --update add build-base \
RUN apk --update --no-cache add build-base \
$PHPIZE_DEPS \
libjpeg-turbo-dev \
imagemagick-dev \
libxml2-dev \
libmcrypt-dev \
freetype \
libjpeg-turbo \
file \
libzip-dev \
libpng \
icu-dev \
g++ \
freetype-dev libpng-dev libjpeg-turbo-dev && \
rm /var/cache/apk/*
freetype-dev \
libpng-dev \
zip \
jpegoptim \
pngquant \
gifsicle \
&& pecl install imagick

ARG PHP_EXTENSION=false

RUN /usr/local/bin/docker-php-ext-install ${PHP_EXTENSION}

RUN /usr/local/bin/docker-php-ext-configure intl && \
/usr/local/bin/docker-php-ext-install intl

ARG PECL_EXTENSION=false

RUN /usr/local/bin/docker-php-ext-configure intl && \
/usr/local/bin/docker-php-ext-install intl

RUN /usr/local/bin/docker-php-ext-install iconv && \
/usr/local/bin/docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ && \
/usr/local/bin/docker-php-ext-install gd
/usr/local/bin/docker-php-ext-configure gd --with-freetype=/usr/include/ --with-jpeg=/usr/include/ && \
/usr/local/bin/docker-php-ext-install gd && \
/usr/local/bin/docker-php-ext-enable imagick

RUN apk del --no-cache freetype-dev libpng-dev libjpeg-turbo-dev
RUN apk del --no-cache freetype-dev libpng-dev

COPY conf/php.ini /usr/local/etc/php/
46 changes: 29 additions & 17 deletions Supervisor/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,37 +1,49 @@
ARG CONTAINER_VERSION=${CONTAINER_VERSION}
FROM php:${CONTAINER_VERSION}-fpm-alpine

#RUN echo "https://mirror.csclub.uwaterloo.ca/alpine/v3.7/main" > /etc/apk/repositories && \
# echo "https://mirror.csclub.uwaterloo.ca/alpine/v3.7/community" >> /etc/apk/repositories

RUN apk --update add build-base \
libmemcached-dev \
libmcrypt-dev \
RUN apk --update --no-cache add build-base \
$PHPIZE_DEPS \
libjpeg-turbo-dev \
imagemagick-dev \
libxml2-dev \
zlib-dev \
autoconf \
cyrus-sasl-dev \
libgsasl-dev \
libmcrypt-dev \
freetype \
libjpeg-turbo \
file \
libzip-dev \
libpng \
icu-dev \
g++ \
freetype-dev libpng-dev libjpeg-turbo-dev \
supervisor && \
rm /var/cache/apk/*
freetype-dev \
libpng-dev \
zip \
jpegoptim \
pngquant \
gifsicle \
&& pecl install imagick

ARG PHP_EXTENSION=false

RUN /usr/local/bin/docker-php-ext-install ${PHP_EXTENSION}

RUN /usr/local/bin/docker-php-ext-configure intl && \
/usr/local/bin/docker-php-ext-install intl

ARG PECL_EXTENSION=false

RUN /usr/local/bin/docker-php-ext-install iconv && \
/usr/local/bin/docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ && \
/usr/local/bin/docker-php-ext-install gd
/usr/local/bin/docker-php-ext-configure gd --with-freetype=/usr/include/ --with-jpeg=/usr/include/ && \
/usr/local/bin/docker-php-ext-install gd && \
/usr/local/bin/docker-php-ext-enable imagick

RUN apk del --no-cache freetype-dev libpng-dev libjpeg-turbo-dev
RUN apk del --no-cache freetype-dev libpng-dev

RUN apk --update --no-cache add build-base \
libmemcached-dev \
zlib-dev \
autoconf \
cyrus-sasl-dev \
libgsasl-dev \
supervisor

COPY supervisord.conf /etc/supervisord.conf

Expand Down
2 changes: 1 addition & 1 deletion Supervisor/config/scheduler.conf
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[program:application-name]
process_name=%(program_name)s_%(process_num)02d
command=php /var/www/html/RentApp/artisan schedule:run >> /dev/null 2>&1
command=php /var/www/html/blog/artisan schedule:run >> /dev/null 2>&1
autostart=true
autorestart=true
numprocs=2
Expand Down
2 changes: 1 addition & 1 deletion Supervisor/config/workers.conf
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[program:application-name]
process_name=%(program_name)s_%(process_num)02d
command=php /var/www/html/RentApp/artisan queue:work --sleep=3 --tries=3 --daemon
command=php /var/www/html/blog/artisan queue:work --sleep=3 --tries=3 --daemon
autostart=true
autorestart=true
numprocs=8
Expand Down
34 changes: 22 additions & 12 deletions Workspace/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,38 +1,48 @@
ARG CONTAINER_VERSION=${CONTAINER_VERSION}
FROM php:${CONTAINER_VERSION}-fpm-alpine

COPY --from=composer:1.6.5 /usr/bin/composer /usr/bin/composer

#RUN echo "https://mirror.csclub.uwaterloo.ca/alpine/v3.7/main" > /etc/apk/repositories && \
# echo "https://mirror.csclub.uwaterloo.ca/alpine/v3.7/community" >> /etc/apk/repositories

RUN apk --update --no-cache add build-base \
git \
$PHPIZE_DEPS \
libjpeg-turbo-dev \
imagemagick-dev \
libxml2-dev \
libmcrypt-dev \
freetype \
libjpeg-turbo \
file \
libzip-dev \
libpng \
icu-dev \
g++ \
freetype-dev libpng-dev libjpeg-turbo-dev
freetype-dev \
libpng-dev \
zip \
jpegoptim \
pngquant \
gifsicle \
&& pecl install imagick

ARG PHP_EXTENSION=false

RUN /usr/local/bin/docker-php-ext-install ${PHP_EXTENSION}

RUN /usr/local/bin/docker-php-ext-configure intl && \
/usr/local/bin/docker-php-ext-install intl

ARG PECL_EXTENSION=false

RUN /usr/local/bin/docker-php-ext-install iconv && \
/usr/local/bin/docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ && \
/usr/local/bin/docker-php-ext-install gd
/usr/local/bin/docker-php-ext-configure gd --with-freetype=/usr/include/ --with-jpeg=/usr/include/ && \
/usr/local/bin/docker-php-ext-install gd && \
/usr/local/bin/docker-php-ext-enable imagick

RUN apk del --no-cache freetype-dev libpng-dev

RUN apk del --no-cache freetype-dev libpng-dev libjpeg-turbo-dev
COPY --from=composer:1.8.5 /usr/bin/composer /usr/bin/composer

RUN addgroup -g 1000 -S appuser && \
adduser -u 1000 -S appuser -G appuser

RUN apk --update --no-cache add npm yarn
RUN apk --update --no-cache add git npm yarn

USER appuser

Expand Down

0 comments on commit 68a3c6d

Please sign in to comment.