Commit 5764f726 authored by Maxime REYROLLE's avatar Maxime REYROLLE
Browse files

replace ci-resource with docker

parent b6e91abd
......@@ -40,21 +40,21 @@ WORKDIR /var/www/pastell/
ENV PATH="${PATH}:/var/www/pastell/vendor/bin/"
# Install requirements
COPY ./ci-resources/install-requirements.sh /var/www/pastell/ci-resources/
RUN /bin/bash /var/www/pastell/ci-resources/install-requirements.sh
COPY ./docker/install-requirements.sh /var/www/pastell/docker/
RUN /bin/bash /var/www/pastell/docker/install-requirements.sh
COPY --from=composer:2 /usr/bin/composer /usr/bin/composer
# Create Pastell needs
COPY ./ci-resources /var/www/pastell/ci-resources
COPY ./docker /var/www/pastell/docker
RUN /bin/bash /var/www/pastell/ci-resources/docker-construction.sh
RUN /bin/bash /var/www/pastell/docker/docker-construction.sh
COPY --chown=${USERNAME}:${GROUPNAME} --from=node_modules /var/www/pastell/node_modules /var/www/pastell/node_modules
# Composer stuff
COPY ./composer.* /var/www/pastell/
RUN /bin/bash /var/www/pastell/ci-resources/github/create-auth-file.sh && \
RUN /bin/bash /var/www/pastell/docker/github/create-auth-file.sh && \
/bin/bash -c 'mkdir -p /var/www/pastell/{web,web-mailsec}' && \
composer install --no-dev --no-autoloader && \
rm -rf /root/.composer/
......@@ -82,6 +82,6 @@ ARG USERNAME=www-data
ARG GROUPNAME=www-data
USER root
RUN /bin/bash /var/www/pastell/ci-resources/install-dev-requirements.sh
RUN /bin/bash /var/www/pastell/docker/install-dev-requirements.sh
USER "${USERNAME}"
FROM pastell_base as pastell_prod
......@@ -88,16 +88,10 @@ il convient donc de spécifier les variables d'environnements directement dans l
Gitlab-ci utilise la commande `entrypoint` mais surcharge la commande.
## Démarrage des services annexes
```bash
docker-compose -f ci-resources/production/docker-compose.yml up -d
```
# Utilisation de l'API Pastell
Pour utiliser l'API de Pastell en PHP, on pourra utiliser le package pastell-api-php
```
composer require libriciel/pastell-api-php
```
\ No newline at end of file
```
......@@ -17,7 +17,7 @@ services:
db:
volumes:
- ./ci-resources/mysql-dev/:/etc/mysql/conf.d/
- ./docker/mysql-dev/:/etc/mysql/conf.d/
ports:
- "${DATABASE_PORT:-8306}:3306"
......
......@@ -10,13 +10,13 @@ chown "${USERNAME}": -R /data/
mkdir -p /data/certificate/
# Supervisord configuration
cp /var/www/pastell/ci-resources/supervisord/supervisord.conf /etc/supervisor/supervisord.conf
cp /var/www/pastell/docker/supervisord/supervisord.conf /etc/supervisor/supervisord.conf
cp /var/www/pastell/ci-resources/logrotate.d/*.conf /etc/logrotate.d/
cp /var/www/pastell/docker/logrotate.d/*.conf /etc/logrotate.d/
# Crond configuration
for CRONFILE in /var/www/pastell/ci-resources/cron.d/*
for CRONFILE in /var/www/pastell/docker/cron.d/*
do
sed -e "s/%USERNAME%/${USERNAME}/g" $CRONFILE > "/etc/cron.d/$(basename $CRONFILE)"
done
......@@ -28,8 +28,8 @@ mkdir -p /var/lib/php/session/
chown "${USERNAME}": /var/lib/php/session
# TODO utiliser le phpenmod
cp /var/www/pastell/ci-resources/php/* /etc/php/8.1/cli/conf.d/
cp /var/www/pastell/ci-resources/php/* /etc/php/8.1/apache2/conf.d/
cp /var/www/pastell/docker/php/* /etc/php/8.1/cli/conf.d/
cp /var/www/pastell/docker/php/* /etc/php/8.1/apache2/conf.d/
# needed for the composer install
......@@ -37,8 +37,8 @@ mkdir -p /var/www/pastell/vendor/
chown "${USERNAME}": /var/www/pastell/vendor/
# Apache configuration
sed -e "s/%USERNAME%/$USERNAME/g" -e "s/%GROUPNAME%/$GROUPNAME/g" /var/www/pastell/ci-resources/apache/envvars > /etc/apache2/envvars
cp /var/www/pastell/ci-resources/pastell-apache-config.conf /etc/apache2/sites-available/pastell-apache-config.conf
sed -e "s/%USERNAME%/$USERNAME/g" -e "s/%GROUPNAME%/$GROUPNAME/g" /var/www/pastell/docker/apache/envvars > /etc/apache2/envvars
cp /var/www/pastell/docker/pastell-apache-config.conf /etc/apache2/sites-available/pastell-apache-config.conf
a2ensite pastell-apache-config.conf
a2dissite 000-default.conf
mkdir /data/run/apache2
......@@ -51,7 +51,7 @@ chown "${USERNAME}": /data/log/apache2
# Create entrypoint command
cp /var/www/pastell/ci-resources/docker-pastell-entrypoint /usr/local/bin/
cp /var/www/pastell/docker/docker-pastell-entrypoint /usr/local/bin/
chmod a+x /usr/local/bin/docker-pastell-entrypoint
bash /var/www/pastell/ci-resources/add-legacy-provider-to-openssl-v3.sh
\ No newline at end of file
bash /var/www/pastell/docker/add-legacy-provider-to-openssl-v3.sh
\ No newline at end of file
#! /bin/bash
set -e
/bin/bash /var/www/pastell/ci-resources/docker-pastell-init > /data/config/DockerSettings.php
/bin/bash /var/www/pastell/docker/docker-pastell-init > /data/config/DockerSettings.php
# Utilisation de l'authentification cliente si nécessaire
if [ "$AUTHENTICATION_WITH_CLIENT_CERTIFICATE" ] ; then
......@@ -29,7 +29,7 @@ if [ -z "$DONT_RETRIEVE_VALIDCA" ] ; then
fi
if [ -z "$DONT_INIT_DATABASE" ] ; then
php /var/www/pastell/ci-resources/init-docker.php
php /var/www/pastell/docker/init-docker.php
fi
exec "$@"
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment