Skip to content
This repository has been archived by the owner on Sep 22, 2020. It is now read-only.

Praxisbeispiel zum BlogPost: Universelles Docker-Image für PHP Silex Anwendung.

License

Notifications You must be signed in to change notification settings

comsysto/poc-dockerized-silex-php-app

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DOCKER SICHER UND
SCHLANK EINSETZEN

Praktische Tipps für sichere Docker Container mit Grsecurity, AppArmor, non-root Environments und Host-Firewall.

Praxisbeispiel zum BlogPost: Universelles Docker-Image für PHP Silex Anwendung.


Benutzung

Bauen des Docker-Images almightyphp

git clone https://github.com/comsysto/poc-dockerized-silex-php-app.git ~/poc-dockerized-silex-php-app
cd ~/poc-dockerized-silex-php-app/
docker build -t almightyphp .

Installation von PHP Abhängigkeiten mit Composer

docker run \
    -i -t \
    -v $(pwd)/php-demo-app/:/phpapp/www \
    -v $(pwd)/php-composer-home/:/phpapp/.composer \
    -v $(pwd)/php-data-dir/:/phpapp/data \
    almightyphp composer update -vvv

Starte die PHP Applikation mit Apache 2 Webserver und PHP7 mit Environment local

docker run \
    -i -t \
    -p 8899:9999 \
    -v $(pwd)/php-demo-app/:/phpapp/www \
    -v $(pwd)/php-composer-home/:/phpapp/.composer \
    -v $(pwd)/php-data-dir/:/phpapp/data \
    almightyphp
    

Starte die PHP Applikation mit Apache 2 Webserver und PHP7 mit Environment staging

docker run \
    -i -t \
    -E ENVIRONMENT=staging
    -p 8899:9999 \
    -v $(pwd)/php-demo-app/:/phpapp/www \
    -v $(pwd)/php-composer-home/:/phpapp/.composer \
    -v $(pwd)/php-data-dir/:/phpapp/data \
    almightyphp

Now open Browser and goto http://localhost:8899/


Das Image ist ca 50MB groß, würde man es auf Docker Hub publishen sicherlich nur die hälfte wegen der Kompression.

docker images
REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE
almightyphp         latest              d1f73902aa78        27 minutes ago      50.95 MB

License

About

Praxisbeispiel zum BlogPost: Universelles Docker-Image für PHP Silex Anwendung.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages