Skip to content

Commit ea6664c

Browse files
committed
initial commit
0 parents  commit ea6664c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

71 files changed

+13145
-0
lines changed

.docker/apache/Dockerfile

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
ARG APACHE_IMAGE_VERSION
2+
3+
FROM httpd:${APACHE_IMAGE_VERSION}-alpine
4+
5+
ARG VHOST_CONF
6+
7+
RUN apk update && apk upgrade
8+
9+
RUN echo -e "Include conf/extra/reqtimeout.conf\nInclude conf/extra/vhost.conf" >> conf/httpd.conf
10+
11+
RUN sed -i \
12+
-e 's/^#\(LoadModule .*mod_rewrite.so\)/\1/' \
13+
-e 's/^#\(LoadModule .*mod_deflate.so\)/\1/' \
14+
-e 's/^#\(LoadModule .*mod_expires.so\)/\1/' \
15+
-e 's/^#\(LoadModule .*mod_http2.so\)/\1/' \
16+
-e 's/^#\(LoadModule .*mod_proxy.so\)/\1/' \
17+
-e 's/^#\(LoadModule .*mod_proxy_fcgi.so\)/\1/' \
18+
conf/httpd.conf
19+
20+
COPY config/reqtimeout.conf conf/extra/
21+
22+
COPY config/vhost.${VHOST_CONF}.conf conf/extra/vhost.conf

.docker/apache/config/reqtimeout.conf

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<IfModule mod_reqtimeout.c>
2+
#The above configuration gives the client a maximum of 20 seconds to start sending header data.
3+
# The client must send header data at a transfer rate of 500 bytes per second and may do it for a maximum of 40 seconds.
4+
# Additionally, the configuration also gives the client a maximum of 20 seconds to start sending body data.
5+
# The client must send message body data at a transfer rate of 500 bytes per second and may do it for a maximum of 40 seconds.
6+
RequestReadTimeout header=20-40,MinRate=500 body=20-40,MinRate=500
7+
</IfModule>

.docker/apache/config/vhost.app.conf

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
ServerName localhost
2+
ServerTokens Prod
3+
ServerSignature Off
4+
5+
<VirtualHost *:80>
6+
Timeout 600
7+
8+
<FilesMatch \.php$>
9+
SetHandler proxy:fcgi://phpfpm:9000
10+
</FilesMatch>
11+
12+
DocumentRoot "/app/public"
13+
DirectoryIndex /index.php
14+
15+
<Directory "/app/public">
16+
Options Indexes FollowSymLinks
17+
AllowOverride All
18+
Require all granted
19+
20+
FallbackResource /index.php
21+
</Directory>
22+
23+
<Directory /app/public/bundles>
24+
DirectoryIndex disabled
25+
FallbackResource disabled
26+
</Directory>
27+
28+
CustomLog /var/log/apache2/access.log combined
29+
ErrorLog /var/log/apache2/error.log
30+
</VirtualHost>

.docker/mysql/Dockerfile

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
ARG MYSQL_IMAGE_VERSION
2+
3+
FROM mysql:${MYSQL_IMAGE_VERSION}
4+
5+
RUN mkdir -p /var/log/mysql && chmod 777 /var/log/mysql
6+
7+
COPY ./config/custom.cnf /etc/mysql/conf.d/custom.cnf

.docker/mysql/config/custom.cnf

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
[mysqld]
2+
default_authentication_plugin=caching_sha2_password
3+
character_set_server=utf8mb4
4+
collation_server=utf8mb4_0900_as_cs
5+
innodb_lock_wait_timeout=60
6+
innodb_rollback_on_timeout=ON
7+
sort_buffer_size=1024K
8+
max_connections=15
9+
max_allowed_packet=128M
10+
performance_schema=off
11+
log_output=FILE
12+
log_queries_not_using_indexes=1
13+
log_slow_admin_statements=1
14+
log_error=/var/log/mysql/error.log
15+
general_log_file=/var/log/mysql/mysql.log
16+
general_log=1
17+
slow_query_log=1
18+
slow_query_log_file=/var/log/mysql/mysql-slow.log
19+
long_query_time=1

.docker/php/Dockerfile

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
ARG PHP_IMAGE_VERSION
2+
3+
FROM php:${PHP_IMAGE_VERSION:-"8.1"}-fpm-buster
4+
5+
LABEL maintainer="ToshY (github.com/ToshY)"
6+
7+
COPY --from=composer:2.5 /usr/bin/composer /usr/local/bin/composer
8+
9+
COPY --from=mlocati/php-extension-installer:1.5 /usr/bin/install-php-extensions /usr/local/bin/
10+
11+
ENV COMPOSER_ALLOW_SUPERUSER=1
12+
13+
RUN install-php-extensions mysqli pdo_mysql exif gd imagick imap opcache soap zip intl gettext sysvsem amqp redis pcntl
14+
15+
RUN apt-get update && apt-get install -y \
16+
software-properties-common \
17+
nano \
18+
zip \
19+
unzip \
20+
ffmpeg \
21+
mkvtoolnix \
22+
libimage-exiftool-perl
23+
24+
WORKDIR /app

.docker/php/conf.d/opcache.ini

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
[opcache]
2+
opcache.enable=${OPCACHE_ENABLE}
3+
opcache.enable_cli=${OPCACHE_ENABLE_CLI}
4+
opcache.revalidate_freq=${OPCACHE_ENABLE_FREQ}
5+
opcache.validate_timestamps=${OPCACHE_VALIDATE_TIMESTAMPS}
6+
opcache.max_accelerated_files=${OPCACHE_MAX_ACCELERATED_FILES}
7+
opcache.memory_consumption=${OPCACHE_MAX_ACCELERATED_FILES}
8+
opcache.max_wasted_percentage=${OPCACHE_MAX_WASTED_PERCENTAGE}
9+
opcache.interned_strings_buffer=${OPCACHE_INTERNED_STRINGS_BUFFER}
10+
opcache.fast_shutdown=${OPCACHE_FAST_SHUTDOWN}
11+
opcache.preload=${OPCACHE_PRELOAD}

.docker/php/conf.d/php.ini

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
[PHP]
2+
apc.enable_cli = 1
3+
session.auto_start = Off
4+
short_open_tag = Off
5+
post_max_size = 6M
6+
upload_max_filesize = 5M
7+
display_errors = on
8+
error_reporting = E_ALL
9+
memory_limit = -1
10+
realpath_cache_size = 4096K
11+
realpath_cache_ttl = 600
12+
expose_php = Off
13+
date.timezone = Europe/Berlin

.docker/php/php-fpm.d/www.conf

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
[www]
2+
pm = dynamic
3+
pm.process_idle_timeout = 10s
4+
pm.max_children = 40
5+
pm.max_requests = 500

.env

+63
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
# In all environments, the following files are loaded if they exist,
2+
# the latter taking precedence over the former:
3+
#
4+
# * .env contains default values for the environment variables needed by the app
5+
# * .env.local uncommitted file with local overrides
6+
# * .env.$APP_ENV committed environment-specific defaults
7+
# * .env.$APP_ENV.local uncommitted environment-specific overrides
8+
#
9+
# Real environment variables win over .env files.
10+
#
11+
# DO NOT DEFINE PRODUCTION SECRETS IN THIS FILE NOR IN ANY OTHER COMMITTED FILES.
12+
#
13+
# Run "composer dump-env prod" to compile .env files for production use (requires symfony/flex >=1.2).
14+
# https://symfony.com/doc/current/best_practices.html#use-environment-variables-for-infrastructure-configuration
15+
16+
###> IMAGE VERSIONS ###
17+
APACHE_IMAGE_VERSION="2.4"
18+
MYSQL_IMAGE_VERSION="8.0"
19+
NODE_IMAGE_VERSION="16-alpine"
20+
###< IMAGE VERSIONS ###
21+
22+
###> symfony/framework-bundle ###
23+
APP_ENV="dev"
24+
APP_DEBUG="1"
25+
APP_SECRET="2ca64f8d83b9e89f5f19d672841d6bb8"
26+
APP_NAME="Webapp"
27+
APP_DOMAIN="webapp.local"
28+
TRUSTED_PROXIES="127.0.0.0/8,10.0.0.0/8,172.16.0.0/12,192.168.0.0/16"
29+
###< symfony/framework-bundle ###
30+
31+
###> opcache ###
32+
OPCACHE_ENABLE="0"
33+
OPCACHE_ENABLE_CLI="0"
34+
OPCACHE_ENABLE_FREQ="0"
35+
OPCACHE_VALIDATE_TIMESTAMPS="1"
36+
OPCACHE_MAX_ACCELERATED_FILES="15331"
37+
OPCACHE_MEMORY_CONSUMPTION="256"
38+
OPCACHE_MAX_WASTED_PERCENTAGE="5"
39+
OPCACHE_INTERNED_STRINGS_BUFFER="12"
40+
OPCACHE_FAST_SHUTDOWN="1"
41+
OPCACHE_PRELOAD="/app/var/cache/${APP_ENV}/App_KernelProdContainer.preload.php"
42+
###< opcache ###
43+
44+
###> database ###
45+
DATABASE_CONNECTION="mysql"
46+
DATABASE_CHARSET="utf8mb4"
47+
DATABASE_COLLATION="utf8mb4_0900_as_cs"
48+
DATABASE_HOST="mysql"
49+
DATABASE_PORT="3306"
50+
DATABASE_NAME="webapp_db"
51+
DATABASE_ROOT_PASSWORD="password"
52+
DATABASE_USER="user"
53+
DATABASE_PASSWORD="password"
54+
DATABASE_URL="${DATABASE_CONNECTION}://${DATABASE_USER}:${DATABASE_PASSWORD}@${DATABASE_HOST}:${DATABASE_PORT}/${DATABASE_NAME}?serverVersion=${MYSQL_IMAGE_VERSION}"
55+
###< database ###
56+
57+
###> symfony/mailer ###
58+
MAILER_DSN=null://null
59+
###< symfony/mailer ###
60+
61+
###> symfony/messenger ###
62+
MESSENGER_TRANSPORT_DSN=doctrine://default
63+
###< symfony/messenger ###

.github/dependabot.yml

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# To get started with Dependabot version updates, you'll need to specify which
2+
# package ecosystems to update and where the package manifests are located.
3+
# Please see the documentation for all configuration options:
4+
# https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
5+
6+
version: 2
7+
updates:
8+
- package-ecosystem: "github-actions"
9+
directory: "/"
10+
target-branch: "main"
11+
schedule:
12+
interval: "weekly"
13+
day: "sunday"
14+
15+
- package-ecosystem: "composer"
16+
directory: "/"
17+
target-branch: "main"
18+
schedule:
19+
interval: "weekly"
20+
day: "sunday"

.github/workflows/phpcs.yml

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: PHPCS
2+
on:
3+
push:
4+
branches:
5+
- main
6+
pull_request:
7+
branches:
8+
- main
9+
10+
jobs:
11+
phpcs:
12+
name: PHP CS Fixer
13+
runs-on: ubuntu-latest
14+
strategy:
15+
matrix:
16+
php-versions:
17+
- '8.1'
18+
- '8.2'
19+
20+
steps:
21+
- name: Checkout
22+
uses: actions/checkout@v3
23+
24+
- name: Setup PHP
25+
uses: shivammathur/setup-php@v2
26+
with:
27+
php-version: ${{ matrix.php-versions }}
28+
29+
- name: Install Composer dependencies
30+
uses: ramsey/composer-install@v2
31+
32+
- name: PHP CS Fixer
33+
run: PHP_CS_FIXER_IGNORE_ENV=1 php vendor/bin/php-cs-fixer fix . --allow-risky=yes --using-cache=no --dry-run -v --diff

.github/workflows/phpmd.yml

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: PHPMD
2+
on:
3+
push:
4+
branches:
5+
- main
6+
pull_request:
7+
branches:
8+
- main
9+
10+
jobs:
11+
phpmd:
12+
name: PHPMD
13+
runs-on: ubuntu-latest
14+
strategy:
15+
matrix:
16+
php-versions:
17+
- '8.1'
18+
- '8.2'
19+
20+
steps:
21+
- name: Checkout
22+
uses: actions/checkout@v3
23+
24+
- name: Setup PHP
25+
uses: shivammathur/setup-php@v2
26+
with:
27+
php-version: ${{ matrix.php-versions }}
28+
29+
- name: Validate composer.json and composer.lock
30+
run: composer validate
31+
32+
- name: Install Composer dependencies
33+
uses: ramsey/composer-install@v2
34+
35+
- name: PHPMD
36+
run: php vendor/bin/phpmd --strict src/ text phpmd.xml

.github/workflows/phpstan.yml

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: PHPStan
2+
on:
3+
push:
4+
branches:
5+
- main
6+
pull_request:
7+
branches:
8+
- main
9+
10+
jobs:
11+
phpcs:
12+
name: PHPStan
13+
runs-on: ubuntu-latest
14+
strategy:
15+
matrix:
16+
php-versions:
17+
- '8.1'
18+
- '8.2'
19+
20+
steps:
21+
- name: Checkout
22+
uses: actions/checkout@v3
23+
24+
- name: Setup PHP
25+
uses: shivammathur/setup-php@v2
26+
with:
27+
php-version: ${{ matrix.php-versions }}
28+
29+
- name: Install Composer dependencies
30+
uses: ramsey/composer-install@v2
31+
32+
- name: PHPStan
33+
run: php vendor/bin/phpstan analyse --error-format=github

.github/workflows/phpunit.yml

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: PHPUnit
2+
on:
3+
push:
4+
branches:
5+
- main
6+
pull_request:
7+
branches:
8+
- main
9+
10+
jobs:
11+
phpcs:
12+
name: PHPUnit
13+
runs-on: ubuntu-latest
14+
strategy:
15+
matrix:
16+
php-versions:
17+
- '8.1'
18+
- '8.2'
19+
20+
steps:
21+
- name: Checkout
22+
uses: actions/checkout@v3
23+
24+
- name: Setup PHP
25+
uses: shivammathur/setup-php@v2
26+
with:
27+
php-version: ${{ matrix.php-versions }}
28+
29+
- name: Install Composer dependencies
30+
uses: ramsey/composer-install@v2
31+
32+
- name: PHPUnit
33+
run: php vendor/bin/phpunit

0 commit comments

Comments
 (0)