Skip to content

Upgrade PHP, Update Config, and add more dependencies #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 24, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 34 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
FROM php:7.1-apache
FROM php:7.2-apache

# Required Components
# @see https://secure.phabricator.com/book/phabricator/article/installation_guide/#installing-required-comp
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
git \
mercurial \
subversion \
ca-certificates \
python-pygments \
&& rm -rf /var/lib/apt/lists/*

# install the PHP extensions we need
Expand All @@ -20,17 +23,27 @@ RUN set -ex; \
apt-get update; \
apt-get install -y --no-install-recommends \
libcurl4-gnutls-dev \
libjpeg62-turbo-dev \
libpng-dev \
libfreetype6-dev \
; \
\
docker-php-ext-configure gd \
--with-jpeg-dir=/usr \
--with-png-dir=/usr \
--with-freetype-dir=/usr \
; \
\
docker-php-ext-install -j "$(nproc)" \
gd \
opcache \
mbstring \
iconv \
mysqli \
curl \
pcntl \
; \
\
\
# reset apt-mark's "manual" list so that "purge --auto-remove" will remove all build dependencies
apt-mark auto '.*' > /dev/null; \
apt-mark manual $savedAptMark; \
Expand Down Expand Up @@ -58,18 +71,34 @@ RUN { \
echo 'opcache.revalidate_freq=60'; \
echo 'opcache.fast_shutdown=1'; \
echo 'opcache.enable_cli=1'; \
echo 'opcache.validate_timestamps=0'; \
} > /usr/local/etc/php/conf.d/opcache-recommended.ini

# Set the default timezone.
RUN { \
echo 'date.timezone="UTC"'; \
} > /usr/local/etc/php/conf.d/timezone.ini

# File Uploads
RUN { \
echo 'post_max_size=32M'; \
echo 'upload_max_filesize=32M'; \
} > /usr/local/etc/php/conf.d/uploads.ini

ENV APACHE_DOCUMENT_ROOT /var/www/phabricator/webroot

RUN { \
echo '<VirtualHost *:80>'; \
echo 'DocumentRoot ${APACHE_DOCUMENT_ROOT}'; \
echo 'RewriteEngine on'; \
echo 'RewriteRule ^(.*)$ /index.php?__path__=$1 [B,L,QSA]'; \
echo ' DocumentRoot ${APACHE_DOCUMENT_ROOT}'; \
echo ' RewriteEngine on'; \
echo ' RewriteRule ^(.*)$ /index.php?__path__=$1 [B,L,QSA]'; \
echo '</VirtualHost>'; \
} > /etc/apache2/sites-available/000-default.conf

# Repository Folder.
RUN mkdir /var/repo \
&& chown www-data:www-data /var/repo

COPY ./ /var/www

WORKDIR /var/www
Expand Down
34 changes: 31 additions & 3 deletions Dockerfile.daemon
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
FROM php:7.1-cli
FROM php:7.2-cli

# Required Components
# @see https://secure.phabricator.com/book/phabricator/article/installation_guide/#installing-required-comp
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
git \
mercurial \
subversion \
ca-certificates \
python-pygments \
&& rm -rf /var/lib/apt/lists/*

# install the PHP extensions we need
Expand All @@ -15,9 +18,19 @@ RUN set -ex; \
apt-get update; \
apt-get install -y --no-install-recommends \
libcurl4-gnutls-dev \
; \
\
libjpeg62-turbo-dev \
libpng-dev \
libfreetype6-dev \
; \
\
docker-php-ext-configure gd \
--with-jpeg-dir=/usr \
--with-png-dir=/usr \
--with-freetype-dir=/usr \
; \
\
docker-php-ext-install -j "$(nproc)" \
gd \
opcache \
mbstring \
iconv \
Expand Down Expand Up @@ -53,8 +66,23 @@ RUN { \
echo 'opcache.revalidate_freq=60'; \
echo 'opcache.fast_shutdown=1'; \
echo 'opcache.enable_cli=1'; \
echo 'opcache.validate_timestamps=0'; \
} > /usr/local/etc/php/conf.d/opcache-recommended.ini

# Set the default timezone.
RUN { \
echo 'date.timezone="UTC"'; \
} > /usr/local/etc/php/conf.d/timezone.ini

# File Uploads
RUN { \
echo 'post_max_size=32M'; \
echo 'upload_max_filesize=32M'; \
} > /usr/local/etc/php/conf.d/uploads.ini

# Repository Folder.
RUN mkdir /var/repo

RUN mkdir -p /var/tmp/phd/log/ \
&& touch /var/tmp/phd/log/daemons.log

Expand Down
3 changes: 3 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ services:
image: phabricator/phabricator
volumes:
- config:/var/www/phabricator/conf/local
- repo:/var/repo
ports:
- 8888:80
links:
Expand All @@ -16,6 +17,7 @@ services:
image: phabricator/daemon
volumes:
- config:/var/www/phabricator/conf/local
- repo:/var/repo
links:
- database
database:
Expand All @@ -28,4 +30,5 @@ services:
MYSQL_ROOT_PASSWORD: CHANGEME
volumes:
config:
repo:
db-data: