Skip to content
Snippets Groups Projects
Commit b29e596c authored by Hahn Axel (hahn)'s avatar Hahn Axel (hahn)
Browse files

update docs

parent fdeb4cf1
Branches
No related tags found
1 merge request!7Replace docker compose
# What problem does it solve?
I have a few php based projects with or without a database.
As a newbie in docker I installed a rootless docker.
And to dockerfy exsiting projects quick and dirty. Sure copy & paste works, but if you have multiple configuration files where variables must match then variables are very helpful. So here is a stupid simple template generator.
The init script:
* sets permisssions for container and local user
* generates needed files for docker from configuration and a set of templates
* starts/ stops your container
# What problems does it not solve?
It is a script for a dual container and Apache + PHP and Mariadb only. Nothing else.
## Requirements ## ## Requirements ##
* Bash (tested on Linux only) It was tested on Linux only.
* Bash + GNU cure utilities
* Docker Non-root installation - see <https://docs.docker.com/engine/security/rootless/> * Docker Non-root installation - see <https://docs.docker.com/engine/security/rootless/>
* ACL to enable write permissions on web data for Apache httpd in the container container and local user (you) * ACL to enable write permissions on web data for Apache httpd in the container container and local user (you)
\ No newline at end of file
...@@ -56,10 +56,10 @@ The initial file structure looks like this: ...@@ -56,10 +56,10 @@ The initial file structure looks like this:
### First start ### ### First start ###
* start init script in the docker folder: ```./docker/init.sh``` * start init script in the docker folder: ```./docker/init.sh```
* use "g" to remove git data of the starterkit * use `g` to remove git data of the starterkit
* use "i" for init ... it sets an ACL on the ./public_html/ subdir to allow write access for your current user and the apache user in the docker container * use `i` for init ... it sets an ACL on the ./public_html/ subdir to allow write access for your current user and the apache user in the docker container
* use "t" to generate config files from templates with the settings from ./docker/init.sh.cfg * use `t` to generate config files from templates with the settings from ./docker/init.sh.cfg
* use "u" to bring up the container (OR run ```docker-compose up -d``` ) * use `u` to bring up the container (OR run ```docker-compose up -d``` )
### Edit files ### ### Edit files ###
......
...@@ -108,8 +108,8 @@ APP_APT_PACKAGES | string | list of additional packages in apache c ...@@ -108,8 +108,8 @@ APP_APT_PACKAGES | string | list of additional packages in apache c
APP_NAME | string | a uniq application name. It will be used as prefix for containers, network and other places. It is a MUST to change it in every new project. APP_NAME | string | a uniq application name. It will be used as prefix for containers, network and other places. It is a MUST to change it in every new project.
APP_ONSTARTUP | string | optional command to execut if the apache container is up "" APP_ONSTARTUP | string | optional command to execut if the apache container is up ""
APP_PHP_MODULES | string | list of additional php modules in apache container; separated with spaces<br>see <https://github.com/mlocati/docker-php-extension-installer> for the list of supported modules<br>example: "curl mbstring xml zip xdebug" APP_PHP_MODULES | string | list of additional php modules in apache container; separated with spaces<br>see <https://github.com/mlocati/docker-php-extension-installer> for the list of supported modules<br>example: "curl mbstring xml zip xdebug"
APP_PHP_VERSION | string | PHP version in apache container; example: 8.1 APP_PHP_VERSION | string | PHP version in apache container; example: 8.2
APP_PORT | int | port number for your local machine that will be maped to port 80 in the container; Change it if you run multiple projects in parallel; example: 8001 APP_PORT | int | port number for your local machine that will be maped to port 80 in the container; Change it if you run multiple projects in parallel; example: 8001;<br>Hint: set one port per application. Coordinate within in your dev team what port to use for what application
CUTTER_NO_DATABASE | const | do not change it; the string is used to cut templates from there if no database is used CUTTER_NO_DATABASE | const | do not change it; the string is used to cut templates from there if no database is used
DB_ADD | bool | flag: do you add a Mariadb container? default: false DB_ADD | bool | flag: do you add a Mariadb container? default: false
DB_PORT | int | port number for your local machine that will be mapped to port 3306 in the container; You can use it in a local db manager; remark: tha apache container needs 3306 and not the mapped port. DB_PORT | int | port number for your local machine that will be mapped to port 3306 in the container; You can use it in a local db manager; remark: tha apache container needs 3306 and not the mapped port.
......
...@@ -164,7 +164,8 @@ Apache vhost configuration for your app. ...@@ -164,7 +164,8 @@ Apache vhost configuration for your app.
**It's a MUST to change this file.** **It's a MUST to change this file.**
Setup modules and the vhost including rewrites , ... Setup your vhost config files.
For the security headers in the buttom part the apache module "headers" ist needed.
```txt ```txt
# TARGET: docker/containers/web-server/apache/sites-enabled/vhost_app.conf # TARGET: docker/containers/web-server/apache/sites-enabled/vhost_app.conf
...@@ -184,6 +185,18 @@ Setup modules and the vhost including rewrites , ... ...@@ -184,6 +185,18 @@ Setup modules and the vhost including rewrites , ...
Require all denied Require all denied
</Location> </Location>
# security headers
Header unset X-Powered-By
Header set Strict-Transport-Security "max-age=63072000; includeSubDomains; preload"
Header set X-Frame-Options "SAMEORIGIN"
Header set X-Content-Type-Options "nosniff"
Header set X-XSS-Protection "1; mode=block"
Header set Feature-Policy "sync-xhr 'self'"
Header set Referrer-Policy "strict-origin-when-cross-origin"
</VirtualHost> </VirtualHost>
``` ```
......
<html>
<div class="hero">
<h2>Configuration</h2>
</div>
</html>
<html>
<div class="hero">
<h2>Docker starter kit</h2>
This template folder brings up a docker container with a PHP 8.x dev environment with<br>
Apache httpd2 + mod_php.<br>
It can add an optionally 2nd container with a Mariadb instance.
</div>
</html>
# Docker starter kit #
Free software and Open Source from University of Bern :: IML - Institute of Medical Education Free software and Open Source from University of Bern :: IML - Institute of Medical Education
...@@ -9,16 +17,6 @@ Free software and Open Source from University of Bern :: IML - Institute of Medi ...@@ -9,16 +17,6 @@ Free software and Open Source from University of Bern :: IML - Institute of Medi
- - - - - -
## About this template ## ## Screenshot ##
This template folder brings up a docker container with a PHP 8.x dev environment with Apache httpd2 + mod_php.
It can add an optionally 2nd container with a Mariadb instance.
![Main menu](images/main_menu.png) ![Main menu](images/main_menu.png)
The init script
* sets permisssions for container and local user
* generates needed files for docker from configuration and a set of templates
* starts/ stops your container
docs/images/main_menu.png

80.9 KiB | W: | H:

docs/images/main_menu.png

338 KiB | W: | H:

docs/images/main_menu.png
docs/images/main_menu.png
docs/images/main_menu.png
docs/images/main_menu.png
  • 2-up
  • Swipe
  • Onion skin
/* /*
override css elements of daux.io blue theme override css elements of daux.io blue theme
version 2023-10-09 version 2023-11-10
*/ */
:root { :root {
/* Axels Overrides */ /* Axels Overrides */
--color-text: #234; --color-text: #234;
--link-color: #822; --link-color: #228;
--brand-color: var(--color-text); --brand-color: var(--color-text);
--brand-background: var(--body-background); --brand-background: var(--body-background);
--code-tag-border-color: #d8d8d8;
--hr-color: none; --hr-color: none;
--search-field-background: none; --search-field-background: none;
--search-field-border-color: none; --search-field-border-color: none;
...@@ -46,9 +47,10 @@ ...@@ -46,9 +47,10 @@
.dark { .dark {
/* Axels Overrides */ /* Axels Overrides */
--color-text: #c0c0c0; --color-text: #c0c0c0;
--link-color: #c66; --link-color: #88e;
--brand-color: var(--color-text); --brand-color: var(--color-text);
--brand-background: var(--body-background); --brand-background: var(--body-background);
--body-background: #101418;
--hr-color: none; --hr-color: none;
--code-tag-background-color_: #bcc; --code-tag-background-color_: #bcc;
--search-field-background: none; --search-field-background: none;
...@@ -175,10 +177,12 @@ img{ ...@@ -175,10 +177,12 @@ img{
.s-content .TableOfContentsContainer h4 { .s-content .TableOfContentsContainer h4 {
margin: 1em 0; margin: 1em 0;
font-size: 100%; font-size: 110%;
text-align: center; text-align: center;
background-color: rgba(0, 0, 0, 0.05); background-color: rgba(0, 0, 0, 0.1);
padding: 0.3em; padding: 0.3em;
font-weight: bold;
font-family: Arial;
} }
ul.TableOfContents a{ ul.TableOfContents a{
color: var(--color-text); color: var(--color-text);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment