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

Re-add Dockerfile to repo for source commenting purposes #5

Open
wants to merge 1 commit into
base: deployandrun
Choose a base branch
from

Conversation

julrich
Copy link
Member

@julrich julrich commented Aug 27, 2018

No description provided.

@@ -0,0 +1,94 @@
FROM webdevops/php-nginx:7.1
Copy link
Member Author

@julrich julrich Aug 27, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Basis-Image, basiert schlussendlich auf dem php-official Image für PHP 7.1, siehe folgender Aufbau des Images (Ebenen vom konkreten, genutzten Image bis zum offiziellen PHP Image):
https://github.com/webdevops/Dockerfile/blob/master/docker/php-nginx/7.1/Dockerfile php-nginx Basis-Image
https://github.com/webdevops/Dockerfile/blob/master/docker/php/7.1 php Basis-Image
https://github.com/webdevops/Dockerfile/blob/master/docker/php-official/7.1/Dockerfile php-official Basis-Image
https://github.com/docker-library/php/blob/master/7.1/jessie/fpm/Dockerfile Offizielles PHP-Image unter debian

Intern wird zum Betrieb von TYPO3 php-fpm, also PHP mit einem Worker- / Ressourcen-Pool, verwendet.


# Add application dir
RUN mkdir -p /app/
WORKDIR /app/
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Legt den zentralen Ordner fest, in dem die Anwendung (hier TYPO3), isoliert, liegt.

&& apt-key add /tmp/nginx_signing.key \
&& apt-get update \
&& export DEBIAN_FRONTEND=noninteractive \
&& apt-get -o Dpkg::Options::="--force-confnew" install -y nginx
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bringt den mitgelieferten Nginx auf die aktuellste, verfügbare Version.

&& apt-get -o Dpkg::Options::="--force-confnew" install -y nginx

# Add directory for PHP socket
RUN mkdir -p /var/run/php
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Kommunikation von Nginx und PHP läuft im Container über einen Socket, nicht über IP.

RUN mkdir -p /var/run/php

# Configure PHP
COPY config/php/99-docker.php.ini /usr/local/etc/php/conf.d/99-docker.ini
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Konfiguration der PHP runtime (memory_limit, timeouts, etc) und dem genutzten OPCache:
https://github.com/ruhmesmeile/php-nginx-typo3/blob/master/config/php/99-docker.php.ini

COPY config/php/99-docker.php.ini /usr/local/etc/php/conf.d/99-docker.ini

# Configure PHP FPM
COPY config/php/application.conf /usr/local/etc/php-fpm.d/application.conf
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Zusätzliche Konfigurationen für die PHP FPM Worker Pool-Konfiguration (Name des ausführenden, Container-internen Nutzers, Größe und Verhalten des Pools, etc):
https://github.com/ruhmesmeile/php-nginx-typo3/blob/master/config/php/application.conf

&& addgroup docker staff \
&& addgroup docker sudo \
&& true \
&& chown -R docker:docker /home/docker/.ssh;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Konfiguration von lokalem Docker-Benutzer, und hinterlegen entsprechender authorized_keys für die internen Benutzer root und application.

&& gpg --recv-keys 5072E1F5 \
&& gpg --export 5072E1F5 > /etc/apt/trusted.gpg.d/5072E1F5.gpg \
&& apt-get update \
&& apt-get --yes install mysql-client
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Installation eines lokalen MySQL-Clients, um Backup und Einspielen von Daten in die Datenbank zu vereinfachen. Kann im Live-Betrieb auch wegfallen.

&& apt-get --yes install mysql-client

# Clean up image
RUN docker-image-cleanup
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Base Image-Task zum Aufräumen des Images, damit dieses nicht in der Folge (aufgrund Repository-Caches, etc) größer als notwendig wird.


# Add utilities to container
COPY util /usr/local/bin/rmutil
RUN chmod a+x /usr/local/bin/rmutil/*
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hinzufügen eines ruhmesmeile-eigenen Utility-Scripts zur nachträglichen Installation von Debugging-Tools (xdebug, gdb, strace) im laufenden Container:
https://github.com/ruhmesmeile/php-nginx-typo3/blob/master/util/enable-debug.util.sh

Kann / sollte für den Live-Betrieb auch wegfallen.


# Add user and fix permissions
RUN adduser www-data application
RUN chmod 0644 /etc/cron.d/typo3
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hinzufügen der genutzten Benutzer (root = Nginx-Rootprozess, PHP-FPM Rootprozess, www-data = Nginx-Workerpool, application = PHP-FPM Workerpool), und Anpassen von Rechten.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant