-
-
Notifications
You must be signed in to change notification settings - Fork 171
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
13 changed files
with
209 additions
and
145 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,89 +1,60 @@ | ||
FROM php:7.4-fpm-buster | ||
ARG PHP_VERSION=8.1 | ||
|
||
FROM serversideup/php:${PHP_VERSION}-fpm-nginx | ||
|
||
ARG SOLIDINVOICE_VERSION | ||
|
||
# Base ENV | ||
ENV TIMEZONE Europe/Paris | ||
ENV TERM xterm | ||
ENV COMPOSER_ALLOW_SUPERUSER 1 | ||
|
||
# Composer ENV | ||
ENV COMPOSER_HTACCESS_PROTECT 0 | ||
ENV COMPOSER_NO_INTERACTION 1 | ||
|
||
COPY --from=composer:2 /usr/bin/composer /usr/bin/composer | ||
# PHP ENV | ||
ENV PHP_DATE_TIMEZONE ${TIMEZONE} | ||
ENV PHP_MAX_EXECUTION_TIME 60 | ||
ENV PHP_POOL_NAME solidinvoice | ||
ENV PHP_SESSION_COOKIE_SECURE 0 | ||
ENV PHP_POST_MAX_SIZE 101M | ||
|
||
SHELL ["/bin/bash", "-c"] | ||
# Setup ENV | ||
ENV AUTORUN_ENABLED 0 | ||
ENV SSL_MODE mixed | ||
ENV S6_LOGGING 1 | ||
|
||
WORKDIR /opt/srv | ||
# Application ENV | ||
ENV SOLIDINVOICE_ENV prod | ||
ENV SOLIDINVOICE_DEBUG 0 | ||
|
||
RUN apt-get update && \ | ||
apt-get install -y \ | ||
${PHPIZE_DEPS} \ | ||
apt-utils \ | ||
debconf-utils \ | ||
apt-transport-https \ | ||
build-essential \ | ||
libicu-dev \ | ||
locales \ | ||
zip \ | ||
unzip \ | ||
unixodbc \ | ||
unixodbc-dev \ | ||
unixodbc-bin \ | ||
libodbc1 \ | ||
odbcinst1debian2 \ | ||
tdsodbc \ | ||
freetds-bin \ | ||
freetds-common \ | ||
freetds-dev \ | ||
libct4 \ | ||
libsybdb5 \ | ||
libxml2 \ | ||
libxslt1-dev \ | ||
libzip-dev \ | ||
curl \ | ||
libcurl4 \ | ||
libedit2 \ | ||
libicu63 \ | ||
libpq-dev \ | ||
git \ | ||
acl \ | ||
openssh-client \ | ||
bash \ | ||
libmcrypt-dev \ | ||
libxml2-dev \ | ||
freetds-dev \ | ||
gcc \ | ||
zlib1g \ | ||
zlib1g-dev \ | ||
libpng-dev \ | ||
libjpeg-dev \ | ||
autoconf \ | ||
wget \ | ||
nginx && \ | ||
pecl install apcu && \ | ||
ln -s /usr/lib/x86_64-linux-gnu/libsybdb.a /usr/lib && \ | ||
docker-php-ext-install -j$(nproc) pdo_mysql pdo_pgsql pdo_dblib opcache bcmath intl gd xsl soap zip && \ | ||
docker-php-ext-enable apcu && \ | ||
echo "en_US.UTF-8 UTF-8" > /etc/locale.gen && locale-gen && \ | ||
apt-get clean && \ | ||
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* && \ | ||
apt-get remove ${PHPIZE_DEPS} -y | ||
SHELL ["/bin/bash", "-c"] | ||
|
||
RUN echo "date.timezone=${TIMEZONE}" >> /usr/local/etc/php/php.ini && \ | ||
echo "max_execution_time = 60;" >> /usr/local/etc/php/php.ini && \ | ||
echo "memory_limit = 512M;" >> /usr/local/etc/php/php.ini && \ | ||
echo "short_open_tag = Off;" >> /usr/local/etc/php/php.ini && \ | ||
RUN apt-get update \ | ||
&& apt-get install -y --no-install-recommends \ | ||
wget \ | ||
php${BUILD_PHP_VERSION}-pdo-mysql \ | ||
php${BUILD_PHP_VERSION}-opcache \ | ||
php${BUILD_PHP_VERSION}-bcmath \ | ||
php${BUILD_PHP_VERSION}-intl \ | ||
php${BUILD_PHP_VERSION}-gd \ | ||
php${BUILD_PHP_VERSION}-xsl \ | ||
php${BUILD_PHP_VERSION}-soap \ | ||
php${BUILD_PHP_VERSION}-zip \ | ||
php${BUILD_PHP_VERSION}-apcu \ | ||
&& apt-get clean \ | ||
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /usr/share/doc/* | ||
|
||
RUN cd /tmp && mkdir solidinvoice && cd solidinvoice && \ | ||
wget "https://github.com/SolidInvoice/SolidInvoice/releases/download/${SOLIDINVOICE_VERSION}/SolidInvoice-${SOLIDINVOICE_VERSION}.zip" && \ | ||
unzip "SolidInvoice-${SOLIDINVOICE_VERSION}.zip" && \ | ||
rm "SolidInvoice-${SOLIDINVOICE_VERSION}.zip" | ||
rm "SolidInvoice-${SOLIDINVOICE_VERSION}.zip" && \ | ||
shopt -s dotglob && \ | ||
mv ./* /var/www/html && \ | ||
cd /tmp && rm -rf solidinvoice && \ | ||
sed -i '/session.cookie_secure/d' /etc/php/current_version/fpm/pool.d/y-override-php-defaults.conf | ||
|
||
ADD docker/conf/nginx.conf /etc/nginx/sites-enabled/default | ||
ADD docker/scripts/run.sh /usr/bin/run | ||
|
||
VOLUME /opt/srv/config | ||
VOLUME /var/www/html/config | ||
|
||
EXPOSE 80 | ||
EXPOSE 443 | ||
|
||
ENTRYPOINT [] | ||
|
||
CMD ["/usr/bin/run"] |
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,34 @@ | ||
ARG SOLIDINVOICE_VERSION | ||
|
||
FROM solidinvoice/solidinvoice:${SOLIDINVOICE_VERSION} | ||
|
||
RUN apt-get update \ | ||
&& apt-get install -y --no-install-recommends \ | ||
mysql-server \ | ||
mysql-common \ | ||
&& apt-get clean \ | ||
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /usr/share/doc/* | ||
|
||
COPY docker/scripts/secure-mysql.sh /usr/local/bin/secure-mysql | ||
|
||
RUN PID=$(mysqld &) && \ | ||
PASSWORD=$(< /dev/urandom tr -dc _A-Z-a-z-0-9 | head -c${1:-32};echo;) && \ | ||
sleep 5 && \ | ||
chmod a+x /usr/local/bin/secure-mysql && \ | ||
/usr/local/bin/secure-mysql $PASSWORD && \ | ||
bin/console app:install -n \ | ||
--database-user=solidinvoice \ | ||
--database-host=127.0.0.1 \ | ||
--database-password=$PASSWORD \ | ||
--locale=en \ | ||
--currency=ZAR \ | ||
--admin-username=admin \ | ||
--admin-password=password \ | ||
--admin-email=test@example.com && \ | ||
killall -15 mysqld | ||
|
||
COPY docker/etc/s6-overlay /etc/s6-overlay | ||
|
||
EXPOSE 3306 | ||
|
||
VOLUME /var/lib/mysql |
This file was deleted.
Oops, something went wrong.
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,10 @@ | ||
#!/command/with-contenv bash | ||
response=$(mysqladmin ping --host=localhost) | ||
|
||
if [[ $response == "mysqld is alive" || $response == "" ]]; then | ||
exit 0 | ||
else | ||
echo "❌ There seems to be a failure in checking the database. Here's the response:" | ||
echo $response | ||
exit 1 | ||
fi |
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 |
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,6 @@ | ||
#!/command/execlineb -P | ||
with-contenv | ||
|
||
# Give MySQL 5 seconds to start up | ||
s6-notifyoncheck -d -s 5000 \ | ||
/usr/sbin/mysqld |
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 @@ | ||
longrun |
Empty file.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.