[08/06/2024] Initial commit

This commit is contained in:
2024-06-08 11:07:49 +02:00
commit b32b05464d
420 changed files with 11740 additions and 0 deletions

View File

View File

@@ -0,0 +1,58 @@
server {
listen 80;
root /application/web/;
index index.php;
access_log /var/log/nginx/starter.tld_access.log;
error_log /var/log/nginx/starter.tld_error.log;
location / {
try_files $uri $uri/ @rewriteapp;
}
location @rewriteapp {
# rewrite all to index.php
rewrite ^(.*)$ /index.php/$1 last;
}
# Php configuration
location ~ ^/(index|index_dev)\.php(/|$) {
# Php-FPM Config (Socks or Network)
#fastcgi_pass unix:/var/run/php/php7.1-fpm.sock;
fastcgi_pass php-fpm:9000;
fastcgi_split_path_info ^(.+\.php)(/.*)$;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_read_timeout 3000;
fastcgi_buffer_size 128k;
fastcgi_buffers 4 256k;
fastcgi_busy_buffers_size 256k;
}
# Security. discard all files and folders starting with a "."
location ~ /\. {
deny all;
access_log off;
log_not_found off;
}
# Stuffs
location = /favicon.ico {
allow all;
access_log off;
log_not_found off;
}
location ~ /robots.txt {
allow all;
access_log off;
log_not_found off;
}
# Static files
location ~* ^.+\.(jpg|jpeg|gif|css|png|js|pdf|zip)$ {
expires 30d;
access_log off;
log_not_found off;
}
}

View File

@@ -0,0 +1,48 @@
FROM php:8.1-fpm-alpine
WORKDIR "/application"
RUN apk --update --no-cache add git
RUN apk add bash
# Zip extension
RUN apk add --no-cache zip libzip-dev
RUN docker-php-ext-install zip
# Calendar extension
RUN docker-php-ext-install calendar
# Imagick extension needed for webp
RUN apk add --update --no-cache autoconf g++ imagemagick imagemagick-dev libtool make pcre-dev
RUN pecl install imagick
RUN docker-php-ext-enable imagick
# GD extension needed for html2pdf
RUN apk add --no-cache freetype libpng libjpeg-turbo freetype-dev libpng-dev libjpeg-turbo-dev && \
docker-php-ext-configure gd \
--with-freetype \
--with-jpeg \
NPROC=$(grep -c ^processor /proc/cpuinfo 2>/dev/null || 1) && \
docker-php-ext-install -j$(nproc) gd && \
apk del --no-cache freetype-dev libpng-dev libjpeg-turbo-dev
# XDebug extension
#RUN apk add --no-cache --virtual .build-deps $PHPIZE_DEPS \
# && pecl install xdebug \
# && docker-php-ext-enable xdebug \
# && apk del -f .build-deps
# Intl extension
RUN apk add icu-dev
RUN docker-php-ext-configure intl && docker-php-ext-install intl
# Mysql extension
RUN docker-php-ext-install pdo_mysql
# Composer copy and run
COPY --from=composer /usr/bin/composer /usr/bin/composer
CMD composer install ; php-fpm
# Copy script used at docker-start
COPY docker-init.sh /usr/local/bin/docker-init
RUN chmod 755 /usr/local/bin/docker-init

View File

@@ -0,0 +1,45 @@
#!/bin/sh
set -e
set -o allexport
eval $(cat '.env' | sed -e '/^#/d;/^\s*$/d' -e 's/\(\w*\)[ \t]*=[ \t]*\(.*\)/\1=\2/' -e "s/=['\"]\(.*\)['\"]/=\1/g" -e "s/'/'\\\''/g" -e "s/=\(.*\)/='\1'/g")
set +o allexport
[ -d local/session ] || mkdir -p local/session
[ -d local/media ] || mkdir -p local/media
chmod -R +w local/session && chmod -R +w local/media
composer install
DB_FILE=local/config/database.yml
if ! test -f "$DB_FILE"; then
php Thelia thelia:install --db_host=mariadb --db_port=3306 --db_username=root --db_name="${MYSQL_DATABASE}" --db_password="${MYSQL_ROOT_PASSWORD}"
php Thelia module:refresh
php Thelia module:activate OpenApi
php Thelia module:activate ChoiceFilter
php Thelia module:activate StoreSeo
php Thelia module:activate ShortCode
php Thelia module:activate ShortCodeMeta
php Thelia module:activate SmartyRedirection
php Thelia module:deactivate HookAdminHome
php Thelia module:deactivate HookAnalytics
php Thelia module:deactivate HookCart
php Thelia module:deactivate HookCustomer
php Thelia module:deactivate HookSearch
php Thelia module:deactivate HookLang
php Thelia module:deactivate HookCurrency
php Thelia module:deactivate HookNavigation
php Thelia module:deactivate HookProductsNew
php Thelia module:deactivate HookSocial
php Thelia module:deactivate HookNewsletter
php Thelia module:deactivate HookContact
php Thelia module:deactivate HookLinks
php Thelia module:deactivate HookProductsOffer
php Thelia template:set frontOffice "${ACTIVE_FRONT_TEMPLATE}"
php Thelia template:set backOffice "${ACTIVE_ADMIN_TEMPLATE}"
php Thelia thelia:config set imagine_graphic_driver imagick
php Thelia admin:create --login_name thelia2 --password thelia2 --last_name thelia2 --first_name thelia2 --email thelia2@example.com
fi
php Thelia module:refresh

View File

@@ -0,0 +1,16 @@
upload_max_filesize = 100M
post_max_size = 108M
html_errors=On
display_errors=On
date.timezone=Europe/Paris
memory_limit=-1
max_execution_time = 300
max_input_vars = 40000
xdebug.idekey = "PHPSTORM"
; --- Xdebug 3 ---
xdebug.mode=debug,develop
xdebug.client_host=172.17.0.1
xdebug.start_with_request=yes
xdebug.discover_client_host=yes