Skip to content
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

Dockerfile optimization #65

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
28 changes: 15 additions & 13 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,20 +1,22 @@
FROM php:7-apache

RUN apt-get update && apt-get install -y git unzip locales curl pkg-config libcurl4-openssl-dev zlib1g-dev libicu-dev g++
RUN docker-php-ext-install mysqli pdo_mysql gettext curl intl mbstring

WORKDIR /var/www/html
COPY . .

RUN set -x && \
apt-get update && apt-get install -y git unzip locales curl pkg-config libcurl4-openssl-dev zlib1g-dev libicu-dev g++ && \
docker-php-ext-install mysqli pdo_mysql gettext curl intl mbstring && \
apt-get remove -y pkg-config libcurl4-openssl-dev zlib1g-dev libicu-dev g++ && \
apt-get clean && \
echo "de_DE.UTF-8 UTF-8" >> /etc/locale.gen && \
echo "en_US.UTF-8 UTF-8" >> /etc/locale.gen && \
locale-gen && \
rm -rf /var/lib/apt/lists/*

USER www-data

COPY --chown=www-data:www-data . .

RUN php composer.phar install -o

RUN chown -R www-data:www-data . && \
find . -type d -print0 | xargs -0 chmod 555 && \
find . -type f -print0 | xargs -0 chmod 444 && \
find data -type d -print0 | xargs -0 chmod 755 && \
find data -type f -print0 | xargs -0 chmod 644 && \
chmod 755 .
VOLUME /var/www/html/data

RUN echo "de_DE.UTF-8 UTF-8" >> /etc/locale.gen && \
echo "en_US.UTF-8 UTF-8" >> /etc/locale.gen && \
locale-gen