🏗️」 wip: work in progress, not done yet.

This commit is contained in:
2025-02-21 12:20:45 +01:00
parent 4056647aea
commit 758f37d7f2
10 changed files with 302 additions and 0 deletions

8
docker/php/Dockerfile Normal file
View File

@ -0,0 +1,8 @@
FROM php:8.4-fpm-alpine
# Installez les dépendances nécessaires pour la compilation d'extensions PHP
RUN apk --no-cache add \
sqlite \
sqlite-dev
RUN mkdir -p /var/www/db && chown -R www-data:www-data /var/www/db

23
docker/web/Dockerfile Normal file
View File

@ -0,0 +1,23 @@
FROM nginx:alpine
RUN apk update && apk add --no-cache \
php84 \
php84-fpm \
php84-opcache \
php84-mysqli \
php84-pdo \
php84-pdo_mysql \
php84-json \
php84-cli \
php84-common \
php84-mbstring \
php84-xml \
php84-curl
COPY ./site /var/www/html
COPY ./docker/web/http-conf/pressf.conf /etc/nginx/conf.d/default.conf
RUN mkdir -p /var/www/db
RUN chown -R nginx:nginx /var/www/db
VOLUME ["/var/www/html", "/var/db"]

View File

@ -0,0 +1,36 @@
server {
listen 0.0.0.0:80; # Écouter sur toutes les interfaces réseau (IPv4)
# Répertoire de travail de Nginx
root /var/www/html;
index index.php index.html;
# Gestion des fichiers PHP avec le socket Unix
location ~ \.php$ {
fastcgi_pass php:9000;
fastcgi_index index.php;
# Paramètre de chemin de fichier pour le traitement PHP
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param DOCUMENT_ROOT $document_root;
# Inclure les paramètres FastCGI standard
include fastcgi_params;
}
# Serveur de fichiers statiques (images, CSS, JS, etc.)
location / {
try_files $uri $uri/ /index.php?$query_string;
}
# Gestion du favicon
location = /favicon.ico {
root /var/www/html;
}
# Gestion des erreurs 404
error_page 404 /404.html;
location = /404.html {
root /usr/share/nginx/html;
}
}