refactor(infra) : reorganize docker config into infra/dev and infra/prod
Some checks failed
Auto Tag Develop / tag (push) Has been cancelled
Some checks failed
Auto Tag Develop / tag (push) Has been cancelled
Align project structure with Lesstime: move docker/ to infra/dev/ and deploy/ to infra/prod/. Update all references in docker-compose, makefile, CI workflow, Dockerfile, .gitignore and .dockerignore. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
9
infra/dev/.env.docker
Normal file
9
infra/dev/.env.docker
Normal file
@@ -0,0 +1,9 @@
|
||||
DOCKER_APP_NAME=inventory
|
||||
DOCKER_PHP_VERSION=8.4.6
|
||||
DOCKER_NODE_VERSION=24.12.0
|
||||
APP_USER=www-data
|
||||
POSTGRES_DB=inventory
|
||||
POSTGRES_USER=root
|
||||
POSTGRES_PASSWORD=root
|
||||
POSTGRES_PORT=5432
|
||||
XDEBUG_CLIENT_HOST=host.docker.internal
|
||||
35
infra/dev/.env.docker.local
Normal file
35
infra/dev/.env.docker.local
Normal file
@@ -0,0 +1,35 @@
|
||||
DOCKER_APP_NAME=inventory
|
||||
DOCKER_PHP_VERSION=8.4.6
|
||||
DOCKER_NODE_VERSION=24.12.0
|
||||
APP_USER=www-data
|
||||
CURRENT_UID=1000
|
||||
CURRENT_GID=1000
|
||||
|
||||
# PostgreSQL
|
||||
POSTGRES_DB=inventory
|
||||
POSTGRES_USER=root
|
||||
POSTGRES_PASSWORD=root
|
||||
#
|
||||
# CORS
|
||||
CORS_ALLOW_ORIGIN=^https?://(localhost|127\\.0\\.0\\.1)(:[0-9]+)?$
|
||||
POSTGRES_PORT=5433
|
||||
|
||||
# pgAdmin
|
||||
PGADMIN_EMAIL=admin@admin.com
|
||||
PGADMIN_PASSWORD=admin
|
||||
PGADMIN_PORT=5050
|
||||
|
||||
# XDebug
|
||||
XDEBUG_CLIENT_HOST=host.docker.internal
|
||||
|
||||
# Symfony (pour future migration)
|
||||
APP_ENV=dev
|
||||
APP_SECRET=changeme_super_secret_key_123456789
|
||||
JWT_SECRET_KEY=%kernel.project_dir%/config/jwt/private.pem
|
||||
JWT_PUBLIC_KEY=%kernel.project_dir%/config/jwt/public.pem
|
||||
JWT_PASSPHRASE=your_jwt_passphrase_change_me
|
||||
|
||||
# NestJS
|
||||
NESTJS_PORT=3000
|
||||
SESSION_SECRET=changeme_session_secret
|
||||
CORS_ORIGIN=http://localhost:3001
|
||||
129
infra/dev/Dockerfile
Normal file
129
infra/dev/Dockerfile
Normal file
@@ -0,0 +1,129 @@
|
||||
ARG DOCKER_PHP_VERSION
|
||||
|
||||
FROM php:${DOCKER_PHP_VERSION}-apache-bullseye
|
||||
|
||||
ARG DOCKER_NODE_VERSION
|
||||
ENV DOCKER_NODE_VERSION="${DOCKER_NODE_VERSION}"
|
||||
|
||||
# Installer les dépendances et extensions PHP nécessaires
|
||||
RUN apt-get update && apt-get install -y \
|
||||
libicu-dev \
|
||||
libpq-dev \
|
||||
libpng-dev \
|
||||
libzip-dev \
|
||||
libxml2-dev \
|
||||
ca-certificates \
|
||||
gnupg \
|
||||
libbz2-dev \
|
||||
libgmp-dev \
|
||||
libldap2-dev \
|
||||
libonig-dev \
|
||||
libsodium-dev \
|
||||
libxslt1-dev \
|
||||
unixodbc-dev \
|
||||
libsqlite3-dev \
|
||||
zlib1g-dev \
|
||||
libssl-dev \
|
||||
libc-client-dev \
|
||||
libkrb5-dev \
|
||||
freetds-dev \
|
||||
vim \
|
||||
tcpdump \
|
||||
dnsutils \
|
||||
wget \
|
||||
git \
|
||||
unzip \
|
||||
qpdf \
|
||||
&& docker-php-ext-install -j$(nproc) \
|
||||
intl \
|
||||
zip \
|
||||
bcmath \
|
||||
bz2 \
|
||||
calendar \
|
||||
exif \
|
||||
gd \
|
||||
gettext \
|
||||
gmp \
|
||||
ldap \
|
||||
# mysqli \
|
||||
pcntl \
|
||||
pdo_pgsql \
|
||||
# pdo_mysql \
|
||||
# pdo_sqlite \
|
||||
# pdo_sqlsrv \
|
||||
soap \
|
||||
sockets \
|
||||
sysvsem \
|
||||
xsl
|
||||
|
||||
|
||||
# Installation de node
|
||||
RUN wget -qO- "https://nodejs.org/dist/v${DOCKER_NODE_VERSION}/node-v${DOCKER_NODE_VERSION}-linux-x64.tar.xz" | tar xJC /tmp/ && \
|
||||
cp -r /tmp/node-v${DOCKER_NODE_VERSION}-linux-x64/bin /usr/ && \
|
||||
cp -r /tmp/node-v${DOCKER_NODE_VERSION}-linux-x64/include /usr/ && \
|
||||
cp -r /tmp/node-v${DOCKER_NODE_VERSION}-linux-x64/lib /usr/ && \
|
||||
cp -r /tmp/node-v${DOCKER_NODE_VERSION}-linux-x64/share /usr/ && \
|
||||
npm install --global yarn
|
||||
|
||||
# installation/activation d'extensions php
|
||||
RUN pecl install xdebug
|
||||
RUN docker-php-ext-enable xdebug && \
|
||||
docker-php-ext-install zip && \
|
||||
docker-php-ext-install gd && \
|
||||
docker-php-ext-install soap && \
|
||||
docker-php-ext-configure intl && \
|
||||
docker-php-ext-install intl
|
||||
|
||||
# Configuration spéciale pour quelques extensions
|
||||
# RUN docker-php-ext-configure pdo_odbc --with-pdo-odbc=unixODBC,/usr && \
|
||||
# docker-php-ext-install pdo_odbc \
|
||||
RUN docker-php-ext-enable opcache
|
||||
|
||||
# Configurer Oracle OCI8 (nécessite le SDK Oracle, à installer manuellement ou à lier via les dépendances)
|
||||
#RUN apt-get update && apt-get -y install wget unzip libaio1 && \
|
||||
# wget https://download.oracle.com/otn_software/linux/instantclient/2340000/instantclient-basic-linux.x64-23.4.0.24.05.zip && \
|
||||
# unzip -o instantclient-basic-linux.x64-23.4.0.24.05.zip -d /usr/local && \
|
||||
# wget https://download.oracle.com/otn_software/linux/instantclient/2340000/instantclient-sdk-linux.x64-23.4.0.24.05.zip && \
|
||||
# unzip -o instantclient-sdk-linux.x64-23.4.0.24.05.zip -d /usr/local
|
||||
#
|
||||
#RUN echo 'instantclient,/usr/local/instantclient_23_4' | pecl install oci8-3.4.0 \
|
||||
# && docker-php-ext-enable oci8
|
||||
#
|
||||
#ENV ORACLE_BASE /usr/local/instantclient_23_4
|
||||
#ENV LD_LIBRARY_PATH /usr/local/instantclient_23_4
|
||||
#ENV TNS_ADMIN /usr/local/instantclient_23_4
|
||||
#ENV ORACLE_HOME /usr/local/instantclient_23_4
|
||||
|
||||
|
||||
# Configuration pour utiliser Kerberos avec IMAP (si nécessaire)
|
||||
# RUN docker-php-ext-configure imap --with-kerberos --with-imap-ssl \
|
||||
# && docker-php-ext-install imap
|
||||
|
||||
# installation de composer
|
||||
RUN rm -rf /var/cache/apk/* && rm -rf /tmp/* && \
|
||||
curl --insecure https://getcomposer.org/composer.phar -o /usr/bin/composer && chmod +x /usr/bin/composer
|
||||
|
||||
# Création de la structure du projet
|
||||
RUN mkdir /var/www/html/LOG
|
||||
|
||||
# Activation du module pour Apache2 proxy_http et rewrite
|
||||
RUN a2enmod proxy_http && \
|
||||
a2enmod rewrite
|
||||
|
||||
###> User ###
|
||||
ARG CURRENT_UID
|
||||
ARG CURRENT_GID
|
||||
# mapping du user host avec www-data
|
||||
RUN usermod -o -u ${CURRENT_UID} www-data && groupmod -o -g ${CURRENT_GID} www-data
|
||||
RUN chown www-data:www-data -R /var/www/*
|
||||
RUN chown www-data:www-data -R /var/www/.*
|
||||
###< User ###
|
||||
|
||||
RUN rm -rf \
|
||||
/var/lib/apt/lists/* \
|
||||
/tmp/* \
|
||||
/var/tmp/*
|
||||
|
||||
WORKDIR /var/www/html
|
||||
|
||||
EXPOSE 80
|
||||
2
infra/dev/pgadmin/pgpass
Normal file
2
infra/dev/pgadmin/pgpass
Normal file
@@ -0,0 +1,2 @@
|
||||
db:5432:inventory:root:root
|
||||
db:5432:*:root:root
|
||||
15
infra/dev/pgadmin/servers.json
Normal file
15
infra/dev/pgadmin/servers.json
Normal file
@@ -0,0 +1,15 @@
|
||||
{
|
||||
"Servers": {
|
||||
"1": {
|
||||
"Name": "Inventory PostgreSQL",
|
||||
"Group": "Servers",
|
||||
"Host": "db",
|
||||
"Port": 5432,
|
||||
"MaintenanceDB": "inventory",
|
||||
"Username": "root",
|
||||
"SSLMode": "prefer",
|
||||
"PassFile": "/var/lib/pgadmin/pgpass",
|
||||
"Comment": "Serveur PostgreSQL du projet Inventory"
|
||||
}
|
||||
}
|
||||
}
|
||||
4
infra/dev/php.ini
Normal file
4
infra/dev/php.ini
Normal file
@@ -0,0 +1,4 @@
|
||||
[Date]
|
||||
; Defines the default timezone used by the date functions
|
||||
; http://php.net/date.timezone
|
||||
date.timezone = Europe/Paris
|
||||
15
infra/dev/vhost.conf
Normal file
15
infra/dev/vhost.conf
Normal file
@@ -0,0 +1,15 @@
|
||||
<VirtualHost *:80>
|
||||
ServerName localhost
|
||||
DocumentRoot /var/www/html/public
|
||||
|
||||
# API Symfony
|
||||
<Directory /var/www/html/public>
|
||||
Options +FollowSymLinks
|
||||
AllowOverride All
|
||||
Require all granted
|
||||
</Directory>
|
||||
|
||||
# Logs
|
||||
ErrorLog ${APACHE_LOG_DIR}/error.log
|
||||
CustomLog ${APACHE_LOG_DIR}/access.log combined
|
||||
</VirtualHost>
|
||||
9
infra/dev/xdebug.ini
Normal file
9
infra/dev/xdebug.ini
Normal file
@@ -0,0 +1,9 @@
|
||||
zend_extension = /usr/local/lib/php/extensions/no-debug-non-zts-20240924/xdebug.so
|
||||
xdebug.mode=debug
|
||||
xdebug.idekey=PHPSTORM
|
||||
xdebug.start_with_request=yes
|
||||
xdebug.discover_client_host=1
|
||||
xdebug.client_port=9003
|
||||
xdebug.log="/var/www/html/LOG/xdebug.log"
|
||||
xdebug.log_level=0
|
||||
xdebug.connect_timeout_ms=2
|
||||
Reference in New Issue
Block a user