Skip to content
Snippets Groups Projects
Commit 034987a0 authored by Romain Ambroise's avatar Romain Ambroise
Browse files

Integration of POC docker | Let documentation  | Database not integrated,...

Integration of POC docker | Let documentation  | Database not integrated, proxy doesn't work as expected
parent 2fb51389
Branches
No related tags found
No related merge requests found
Showing
with 1117 additions and 2 deletions
.env
\ No newline at end of file
LICENCE 0 → 100644
This diff is collapsed.
# SMILE+ # SMILE+
Les relations internationales des universités françaises font face à de profonds changements : structuration des Établissement Public Expérimentaux, déploiement des universités européennes, accroissement du nombre de mobilités, obligation de digitalisation du programme Erasmus, incertitude géopolitique et sanitaire. Les outils existants ne répondant pas à ces problématiques, un ensemble d'établissements s'est regroupé afin de construire une solution commune donnant naissance à une 1ère application (SMILE) sur le périmètre des mobilités entrantes. ![alt smile logo](./documentation/assets/logo_smile.png)
Le projet SMILE+ vise à créer une solution numérique complète prenant en charge la gestion de la coopération internationale : gestion des partenariats, des mobilités (entrante et sortante) et les services/accueil à l'usager. Les fonctionnalités intégrées dans SMILE+ seront : la gestion des accords et des conventions de partenariats, des établissements partenaires, des candidatures et nominations des étudiants et personnels, des financements et des demandes de logements, veille sécuritaire, ainsi que le suivi des indicateurs et l'aide à la gestion de crise. Cette solution permettra le suivi intégral de la coopération et de la mobilité (tout type, toute personne) dans les établissements utilisateurs. Elle permettra les extractions nécessaires pour des suivis macros et micros, dans et en dehors de l'application.
## Contexte
           Les relations internationales des universités françaises font face à de profonds changements : structuration des Établissement Public Expérimentaux, déploiement des universités européennes, accroissement du nombre de mobilités, obligation de digitalisation du programme Erasmus, incertitude géopolitique et sanitaire.
Les outils existants ne répondant pas à ces problématiques, un ensemble d'établissements s'est regroupé afin de construire une solution commune donnant naissance à une 1ère application (SMILE) sur le périmètre des mobilités entrantes.
           Le projet SMILE+ vise à créer une solution numérique complète prenant en charge la gestion de la coopération internationale : gestion des partenariats, des mobilités (entrante et sortante) et les services/accueil à l'usager.
Les fonctionnalités intégrées dans SMILE+ seront : la gestion des accords et des conventions de partenariats, des établissements partenaires, des candidatures et nominations des étudiants et personnels, des financements et des demandes de logements, veille sécuritaire, ainsi que le suivi des indicateurs et l'aide à la gestion de crise.
Cette solution permettra le suivi intégral de la coopération et de la mobilité (tout type, toute personne) dans les établissements utilisateurs. Elle permettra les extractions nécessaires pour des suivis macros et micros, dans et en dehors de l'application.
# Mises à jour
La [`liste des changements`](./documentation/CHANGELOG.md) vous permettra de savoir :
- si une nouvelle version est sortie
- quelles en sont les nouveautés
- quels sont les éventuels bugs corrigés
- s'il y a des notes de mise à jour à prendre en compte pour installer cette nouvelle version.
# Installation et mise à jour
Une [`procédure d'installation`](./documentation/INSTALL_ON_PREMISE.md) est à votre disposition pour mettre en place une nouvelle instance de SMILE, que ce soit en test ou en production.
La [`procédure de mise à jour`](./documentation/UPDATE.md) vous indiquera comment mettre à niveau votre instance.
# Mode SAAS
Nous proposons l'application en mode SAAS via l'association ESUP-Portail.
[Voir SAAS.md`](./documentation/SAAS_MODE.md)
# Nous contacter
Pour une première prise de contact, vous pouvez nous joindre au moyen de l'adresse mail ????
APP_VERSION: "1.3.31"
API_CORE_VERSION: "0.0.1"
FRONTEND_VERSION: "0.0.1"
MEMCACHED_VERSION: "1.6.21-6"
TIMEMACHINE_VERSION: "1.2.17"
DATABASE_VERSION: "13.7.1-30"
\ No newline at end of file
**/
\ No newline at end of file
Listen 80
Listen 443 https
\ No newline at end of file
[supervisord]
nodaemon=true
[program:apache2]
command=/usr/sbin/apache2ctl -D FOREGROUND
autostart=true
autorestart=true
\ No newline at end of file
<VirtualHost *:80>
ServerAdmin smile@unicaen.fr
ServerName localhost
# Empêche Apache d'envoyer les requêtes /api vers le frontend
ProxyPass /api/ !
# Gestion de PHP-FPM pour API Platform
<FilesMatch \.php$>
SetHandler "proxy:fcgi://smile-plus-api:9000"
</FilesMatch>
# Alias pour servir l'API
Alias /api /var/www/html/smile-api/public/
DocumentRoot /var/www/html/smile-api/public/
DirectoryIndex index.php
<Directory /var/www/html/smile-api/public>
Require all granted
Options -Indexes +FollowSymLinks
AllowOverride All
</Directory>
# Redirection des requêtes API vers index.php pour gérer les routes imbriquées
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^api/(.*)$ /index.php [QSA,L]
</IfModule>
# ProxyPass pour rediriger toutes les autres routes vers le frontend
ProxyPass / http://smile-plus-frontend:5173/
ProxyPassReverse / http://smile-plus-frontend:5173/
# Logs
ErrorLog ${APACHE_LOG_DIR}/smile_error.log
CustomLog ${APACHE_LOG_DIR}/smile_access.log combined
SetEnv APPLICATION_ENV ${APP_ENV}
</VirtualHost>
pm = dynamic
pm.max_children = 50
pm.start_servers = 5
pm.min_spare_servers = 5
pm.max_spare_servers = 10
pm.max_requests = 500
opcache.enable=0
opcache.memory_consumption=128
opcache.interned_strings_buffer=8
opcache.max_accelerated_files=4000
opcache.revalidate_freq=2
opcache.fast_shutdown=1
memory_limit = 512M
max_execution_time = 60
upload_max_filesize = 32M
post_max_size = 32M
zlib.output_compression = on
display_errors = On
error_reporting = E_ALL
log_errors = On
# memcached.servers = memcached:11211
# memcached.session_save_handler = memcached
;listen.allowed_clients = 172.22.0.0/24
listen = 9000
error_reporting=E_ALL
\ No newline at end of file
;;;;;;;;;;;;;;;;;;;;;
; FPM Configuration ;
;;;;;;;;;;;;;;;;;;;;;
; All relative paths in this configuration file are relative to PHP's install
; prefix (/usr/local). This prefix can be dynamically changed by using the
; '-p' argument from the command line.
;;;;;;;;;;;;;;;;;;
; Global Options ;
;;;;;;;;;;;;;;;;;;
[global]
; Pid file
; Note: the default prefix is /usr/local/var
; Default Value: none
;pid = run/php-fpm.pid
; Error log file
; If it's set to "syslog", log is sent to syslogd instead of being written
; into a local file.
; Note: the default prefix is /usr/local/var
; Default Value: log/php-fpm.log
error_log = log/php-fpm.log
; syslog_facility is used to specify what type of program is logging the
; message. This lets syslogd specify that messages from different facilities
; will be handled differently.
; See syslog(3) for possible values (ex daemon equiv LOG_DAEMON)
; Default Value: daemon
;syslog.facility = daemon
; syslog_ident is prepended to every message. If you have multiple FPM
; instances running on the same server, you can change the default value
; which must suit common needs.
; Default Value: php-fpm
;syslog.ident = php-fpm
; Log level
; Possible Values: alert, error, warning, notice, debug
; Default Value: notice
;log_level = notice
; Log limit on number of characters in the single line (log entry). If the
; line is over the limit, it is wrapped on multiple lines. The limit is for
; all logged characters including message prefix and suffix if present. However
; the new line character does not count into it as it is present only when
; logging to a file descriptor. It means the new line character is not present
; when logging to syslog.
; Default Value: 1024
;log_limit = 4096
; Log buffering specifies if the log line is buffered which means that the
; line is written in a single write operation. If the value is false, then the
; data is written directly into the file descriptor. It is an experimental
; option that can potentially improve logging performance and memory usage
; for some heavy logging scenarios. This option is ignored if logging to syslog
; as it has to be always buffered.
; Default value: yes
;log_buffering = no
; If this number of child processes exit with SIGSEGV or SIGBUS within the time
; interval set by emergency_restart_interval then FPM will restart. A value
; of '0' means 'Off'.
; Default Value: 0
;emergency_restart_threshold = 0
; Interval of time used by emergency_restart_interval to determine when
; a graceful restart will be initiated. This can be useful to work around
; accidental corruptions in an accelerator's shared memory.
; Available Units: s(econds), m(inutes), h(ours), or d(ays)
; Default Unit: seconds
; Default Value: 0
;emergency_restart_interval = 0
; Time limit for child processes to wait for a reaction on signals from master.
; Available units: s(econds), m(inutes), h(ours), or d(ays)
; Default Unit: seconds
; Default Value: 0
;process_control_timeout = 0
; The maximum number of processes FPM will fork. This has been designed to control
; the global number of processes when using dynamic PM within a lot of pools.
; Use it with caution.
; Note: A value of 0 indicates no limit
; Default Value: 0
; process.max = 128
; Specify the nice(2) priority to apply to the master process (only if set)
; The value can vary from -19 (highest priority) to 20 (lowest priority)
; Note: - It will only work if the FPM master process is launched as root
; - The pool process will inherit the master process priority
; unless specified otherwise
; Default Value: no set
; process.priority = -19
; Send FPM to background. Set to 'no' to keep FPM in foreground for debugging.
; Default Value: yes
;daemonize = no
; Set open file descriptor rlimit for the master process.
; Default Value: system defined value
;rlimit_files = 1024
; Set max core size rlimit for the master process.
; Possible Values: 'unlimited' or an integer greater or equal to 0
; Default Value: system defined value
;rlimit_core = 0
; Specify the event mechanism FPM will use. The following is available:
; - select (any POSIX os)
; - poll (any POSIX os)
; - epoll (linux >= 2.5.44)
; - kqueue (FreeBSD >= 4.1, OpenBSD >= 2.9, NetBSD >= 2.0)
; - /dev/poll (Solaris >= 7)
; - port (Solaris >= 10)
; Default Value: not set (auto detection)
;events.mechanism = epoll
; When FPM is built with systemd integration, specify the interval,
; in seconds, between health report notification to systemd.
; Set to 0 to disable.
; Available Units: s(econds), m(inutes), h(ours)
; Default Unit: seconds
; Default value: 10
;systemd_interval = 10
;;;;;;;;;;;;;;;;;;;;
; Pool Definitions ;
;;;;;;;;;;;;;;;;;;;;
; Multiple pools of child processes may be started with different listening
; ports and different management options. The name of the pool will be
; used in logs and stats. There is no limitation on the number of pools which
; FPM can handle. Your system will tell you anyway :)
; Include one or more files. If glob(3) exists, it is used to include a bunch of
; files from a glob(3) pattern. This directive can be used everywhere in the
; file.
; Relative path can also be used. They will be prefixed by:
; - the global prefix if it's been set (-p argument)
; - /usr/local otherwise
include=etc/php-fpm.d/*.conf
[www]
user = www-data
group = www-data
listen = 9000
pm = dynamic
pm.max_children = 50
pm.start_servers = 5
pm.min_spare_servers = 5
pm.max_spare_servers = 10
pm.max_requests = 500
\ No newline at end of file
[supervisord]
nodaemon=true
[program:cron]
command=/usr/sbin/cron -f
autostart=true
autorestart=true
[program:php-fpm]
command=/usr/local/sbin/php-fpm -F
autostart=true
autorestart=true
\ No newline at end of file
FROM ubuntu:20.04
# Set timezone
ENV TZ=Europe/Paris
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
RUN if [ -f ./deployment-configuration/proxy/.env_proxy ]; then \
# Si le fichier source existe, copiez-le
COPY ./deployment-configuration/proxy/.env_proxy /; \
fi
COPY ./deployment-configuration/proxy/proxy.sh /
RUN chmod +x /proxy.sh
RUN sh /proxy.sh
ARG HTTP_PROXY_CI
ENV http_proxy=$HTTP_PROXY_CI
ENV https_proxy=$HTTP_PROXY_CI
ENV HTTP_PROXY=$HTTP_PROXY_CI
ENV HTTPS_PROXY=$HTTP_PROXY_CI
# Vérifiez si la variable d'environnement http_proxy est définie
RUN if [ -n "$http_proxy" ]; then \
# Si elle est définie, exécutez les commandes pour configurer le proxy
touch /etc/apt/apt.conf.d/05proxy; \
echo 'Acquire::HTTP::Proxy "'$http_proxy'";' >> /etc/apt/apt.conf.d/05proxy; \
echo 'Acquire::HTTPS::Prox "'$http_proxy'";' >> /etc/apt/apt.conf.d/05proxy; \
echo 'Acquire::ftp::Proxy "'$http_proxy'";' >> /etc/apt/apt.conf.d/05proxy; \
echo "Proxy configuré dans le système de packages avec la valeur $http_proxy" && true; \
fi
RUN apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
apache2 apache2-bin libapache2-mod-fcgid
RUN apt-get install -y apache2
RUN apt-get install -y supervisor
## Paquets pour le wayf
COPY ./deployment-configuration/apache/vhosts/000-default.conf /
### Configuration WayF
WORKDIR /
###Fin Config WayF
COPY ./deployment-configuration/apache/supervisord.conf /
RUN a2enmod rewrite actions proxy proxy_fcgi setenvif
COPY ./deployment-configuration/apache/ports.conf /etc/apache2
RUN a2enconf security
RUN apt-get install -y cron
RUN apt-get install -y supervisor
RUN apt-get install -y gettext-base
RUN a2enmod ssl
RUN a2ensite 000-default
#RUN a2ensite default-ssl
RUN mkdir /var/www/html/smile-api
WORKDIR /var/www/html/smile-api/
COPY ./smile-plus-api /var/www/html/smile-api/
WORKDIR /var/www/html/smile-api/public
COPY ./.env /var/www/html/smile-api/.env
ENV HTTP_PROXY=""
ENV HTTPS_PROXY=""
ENV http_proxy=""
ENV https_proxy=""
RUN rm -f /etc/apt/apt.conf.d/05proxy
EXPOSE 80
EXPOSE 443
\ No newline at end of file
FROM php:8.2-fpm-bullseye
#Timezone
ENV TZ=Europe/Paris
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
ENV PHP_VERSION=8.2
RUN if [ -f ./deployment-configuration/proxy/.env_proxy ]; then \
# Si le fichier source existe, copiez-le
COPY ./deployment-configuration/proxy/.env_proxy /; \
fi
COPY ./deployment-configuration/proxy/proxy.sh /
RUN chmod +x /proxy.sh
RUN sh /proxy.sh
ARG HTTP_PROXY_CI
ENV http_proxy=$HTTP_PROXY_CI
ENV https_proxy=$HTTP_PROXY_CI
ENV HTTP_PROXY=$HTTP_PROXY_CI
ENV HTTPS_PROXY=$HTTP_PROXY_CI
# Vérifiez si la variable d'environnement http_proxy est définie
RUN if [ -n "$http_proxy" ]; then \
# Si elle est définie, exécutez les commandes pour configurer le proxy
touch /etc/apt/apt.conf.d/05proxy; \
echo 'Acquire::HTTP::Proxy "'$http_proxy'";' >> /etc/apt/apt.conf.d/05proxy; \
echo 'Acquire::HTTPS::Prox "'$http_proxy'";' >> /etc/apt/apt.conf.d/05proxy; \
echo 'Acquire::ftp::Proxy "'$http_proxy'";' >> /etc/apt/apt.conf.d/05proxy; \
echo "Proxy configuré dans le système de packages avec la valeur $http_proxy" && true; \
fi
RUN apt-get update -y
# Deploy configuration & sources
RUN mkdir /var/www/html/smile-api
WORKDIR /var/www/html/smile-api/
COPY ./smile-plus-api /var/www/html/smile-api/
# Préparation des variables d'environnement
COPY .env /var/www/html/smile-api/
# Prepare packages management
ADD --chmod=0755 https://github.com/mlocati/docker-php-extension-installer/releases/latest/download/install-php-extensions /usr/local/bin/
RUN rm -f /etc/apt/preferences.d/no-debian-php
RUN apt-get update -y
RUN apt-get install -y git libc6 wget gnupg2 apt-transport-https lsb-release ca-certificates
RUN apt-get -qq update
RUN apt-get -y install apt-transport-https lsb-release ca-certificates curl
RUN curl -sSLo /usr/share/keyrings/deb.sury.org-php.gpg https://packages.sury.org/php/apt.gpg
RUN sh -c 'echo "deb [signed-by=/usr/share/keyrings/deb.sury.org-php.gpg] https://packages.sury.org/php/ $(lsb_release -sc) main" > /etc/apt/sources.list.d/php.list'
RUN wget -e use_proxy=on -e https_proxy=$HTTP_PROXY --no-check-certificate -O /etc/apt/trusted.gpg.d/php.gpg https://packages.sury.org/php/apt.gpg
RUN echo "deb https://packages.sury.org/php/ $(lsb_release -sc) main" | tee /etc/apt/sources.list.d/php.list
RUN apt-get upgrade -y
RUN apt-get update -y
RUN install-php-extensions \
@composer \
apcu \
intl \
opcache \
zip \
;
RUN rm /usr/local/etc/php-fpm.conf
RUN rm /usr/local/etc/php-fpm.d/www.conf
# Build Smile
WORKDIR /var/www/html/smile-api/
ENV COMPOSER_ALLOW_SUPERUSER=1
WORKDIR /var/www/html/smile-api/
RUN composer install --no-scripts
ENV HTTP_PROXY=""
ENV HTTPS_PROXY=""
ENV http_proxy=""
ENV https_proxy=""
RUN rm -f /etc/apt/apt.conf.d/05proxy
RUN chown -R www-data:www-data /var/www/html/smile-api/
ENV COMPOSER_ALLOW_SUPERUSER=0
FROM node:20.17.0 AS build
RUN if [ -f ./deployment-configuration/proxy/.env_proxy ]; then \
COPY ./deployment-configuration/proxy/.env_proxy /; \
fi
COPY ./deployment-configuration/proxy/proxy.sh /
RUN chmod +x /proxy.sh
RUN sh /proxy.sh
ARG HTTP_PROXY_CI
ENV http_proxy=$HTTP_PROXY_CI
ENV https_proxy=$HTTP_PROXY_CI
ENV HTTP_PROXY=$HTTP_PROXY_CI
ENV HTTPS_PROXY=$HTTP_PROXY_CI
# Vérifiez si la variable d'environnement http_proxy est définie
RUN if [ -n "$http_proxy" ]; then \
# Si elle est définie, exécutez les commandes pour configurer le proxy
touch /etc/apt/apt.conf.d/05proxy; \
echo 'Acquire::HTTP::Proxy "'$http_proxy'";' >> /etc/apt/apt.conf.d/05proxy; \
echo 'Acquire::HTTPS::Prox "'$http_proxy'";' >> /etc/apt/apt.conf.d/05proxy; \
echo 'Acquire::ftp::Proxy "'$http_proxy'";' >> /etc/apt/apt.conf.d/05proxy; \
echo "Proxy configuré dans le système de packages avec la valeur $http_proxy" && true; \
npm config set proxy $http_proxy; \
npm config set https-proxy $https_proxy; \
fi
WORKDIR /app
COPY ./smile-plus-frontend .
RUN rm -f /app/package-lock.json
RUN npm install
ENV HTTP_PROXY ""
ENV HTTPS_PROXY ""
ENV http_proxy ""
ENV https_proxy ""
RUN rm -f /etc/apt/apt.conf.d/05proxy
RUN npm config delete proxy
RUN npm config delete https-proxy
EXPOSE 5173
\ No newline at end of file
FROM postgres:13.7
# Set timezone
ENV TZ=Europe/Paris
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
RUN if [ -f ./deployment-configuration/proxy/.env_proxy ]; then \
# Si le fichier source existe, copiez-le
COPY ./deployment-configuration/proxy/.env_proxy /; \
fi
COPY ./deployment-configuration/proxy/proxy.sh /
RUN chmod +x /proxy.sh
RUN sh /proxy.sh
ARG HTTP_PROXY_CI
ENV http_proxy=$HTTP_PROXY_CI
ENV https_proxy=$HTTP_PROXY_CI
ENV HTTP_PROXY=$HTTP_PROXY_CI
ENV HTTPS_PROXY=$HTTP_PROXY_CI
# Vérifiez si la variable d'environnement http_proxy est définie
RUN if [ -n "$http_proxy" ]; then \
# Si elle est définie, exécutez les commandes pour configurer le proxy
touch /etc/apt/apt.conf.d/05proxy; \
echo 'Acquire::HTTP::Proxy "'$http_proxy'";' >> /etc/apt/apt.conf.d/05proxy; \
echo 'Acquire::HTTPS::Prox "'$http_proxy'";' >> /etc/apt/apt.conf.d/05proxy; \
echo 'Acquire::ftp::Proxy "'$http_proxy'";' >> /etc/apt/apt.conf.d/05proxy; \
echo "Proxy configuré dans le système de packages avec la valeur $http_proxy" && true; \
fi
RUN apt-get update
RUN apt-get install -y python3-full python3-pip
RUN apt-get install -y python3-boto3
COPY ./deployment-configuration/database/download-dump-instance-s3.py /
RUN chmod u+x /download-dump-instance-s3.py
RUN mkdir /scripts_to_init
COPY ./deployment-configuration/database/db /scripts_to_init
RUN chmod -R 777 /scripts_to_init
RUN mkdir /smile-database-data
RUN chmod -R 700 /smile-database-data
COPY ./deployment-configuration/database/run_sql.sh /docker-entrypoint-initdb.d/
RUN chmod u+x /docker-entrypoint-initdb.d/run_sql.sh
RUN apt-get update && apt-get install -y unzip
ENV HTTP_PROXY=""
ENV HTTPS_PROXY=""
ENV http_proxy=""
ENV https_proxy=""
RUN rm -f /etc/apt/apt.conf.d/05proxy
EXPOSE 5432
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment