-
Notifications
You must be signed in to change notification settings - Fork 196
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
75 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -34,3 +34,4 @@ src | |
.ruby-version | ||
|
||
.bundle | ||
docker-compose/.env |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
FROM composer:2.4 AS composer | ||
|
||
FROM php:8-fpm | ||
|
||
LABEL maintainer="Passbolt SA <[email protected]>" | ||
|
@@ -8,6 +10,7 @@ ARG PASSBOLT_CURL_HEADERS="" | |
ARG PASSBOLT_FLAVOUR="ce" | ||
|
||
ARG PHP_EXTENSIONS="gd \ | ||
zip \ | ||
intl \ | ||
pdo_mysql \ | ||
opcache \ | ||
|
@@ -24,6 +27,8 @@ ARG PASSBOLT_DEV_PACKAGES="libgpgme11-dev \ | |
libicu-dev \ | ||
libxslt1-dev \ | ||
libmcrypt-dev \ | ||
libzip-dev \ | ||
zip \ | ||
unzip \ | ||
libldap2-dev" | ||
|
||
|
@@ -40,6 +45,9 @@ ENV PHP_EXT_DIR="/usr/src/php/ext" | |
ENV PASSBOLT_FLAVOUR=$PASSBOLT_FLAVOUR | ||
|
||
WORKDIR /var/www/passbolt | ||
|
||
COPY --from=composer /usr/bin/composer /usr/bin/composer | ||
|
||
RUN apt-get update \ | ||
&& apt-get -y install --no-install-recommends \ | ||
$PASSBOLT_DEV_PACKAGES \ | ||
|
@@ -56,31 +64,18 @@ RUN apt-get update \ | |
&& docker-php-ext-install -j4 $PHP_EXTENSIONS $PECL_PASSBOLT_EXTENSIONS \ | ||
&& docker-php-ext-enable $PHP_EXTENSIONS $PECL_PASSBOLT_EXTENSIONS \ | ||
&& docker-php-source delete \ | ||
&& EXPECTED_SIGNATURE=$(curl -s https://composer.github.io/installer.sig) \ | ||
&& curl -o composer-setup.php https://getcomposer.org/installer \ | ||
&& ACTUAL_SIGNATURE=$(php -r "echo hash_file('SHA384', 'composer-setup.php');") \ | ||
&& if [ "$EXPECTED_SIGNATURE" != "$ACTUAL_SIGNATURE" ]; then \ | ||
>&2 echo 'ERROR: Invalid installer signature'; \ | ||
rm composer-setup.php; \ | ||
exit 1; \ | ||
fi \ | ||
&& php composer-setup.php \ | ||
&& mv composer.phar /usr/local/bin/composer \ | ||
&& rm composer-setup.php \ | ||
&& curl -sSL -H "$PASSBOLT_CURL_HEADERS" "$PASSBOLT_URL" | tar zxf - -C . --strip-components 1 \ | ||
&& composer install -n --no-dev --optimize-autoloader \ | ||
&& composer install --no-ansi --no-interaction \ | ||
&& chown -R www-data:www-data . \ | ||
&& chmod 775 $(find /var/www/passbolt/tmp -type d) \ | ||
&& chmod 664 $(find /var/www/passbolt/tmp -type f) \ | ||
&& chmod 775 $(find /var/www/passbolt/webroot/img/public -type d) \ | ||
&& chmod 664 $(find /var/www/passbolt/webroot/img/public -type f) \ | ||
&& rm /etc/nginx/sites-enabled/default \ | ||
&& apt-get purge -y --auto-remove $PASSBOLT_DEV_PACKAGES \ | ||
&& rm -rf /var/lib/apt/lists/* \ | ||
&& rm /usr/local/bin/composer \ | ||
&& echo 'php_flag[expose_php] = off' > /usr/local/etc/php-fpm.d/expose.conf \ | ||
&& sed -i 's/# server_tokens/server_tokens/' /etc/nginx/nginx.conf \ | ||
&& mv "$PHP_INI_DIR/php.ini-production" "$PHP_INI_DIR/php.ini" \ | ||
&& mv "$PHP_INI_DIR/php.ini-development" "$PHP_INI_DIR/php.ini" \ | ||
&& echo "* * * * * su -c \"source /etc/environment ; /var/www/passbolt/bin/cake EmailQueue.sender\" -s /bin/bash www-data >> /var/log/cron.log 2>&1" >> /etc/cron.d/passbolt_email \ | ||
&& crontab /etc/cron.d/passbolt_email \ | ||
&& ln -s $(which php-fpm) $(which php-fpm)7.3 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
PASSBOLT_API_PATH="/path/to/passbolt_api" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
CREATE DATABASE IF NOT EXISTS `test_passbolt`; | ||
GRANT ALL PRIVILEGES ON test_passbolt.* TO 'passbolt'@'%'; | ||
FLUSH PRIVILEGES; |