Skip to content

Commit

Permalink
merge-up/2.2.x-into-2.3.x (#786)
Browse files Browse the repository at this point in the history
  • Loading branch information
pierredup committed May 1, 2023
2 parents 9b311bf + 558daa1 commit 948a7d6
Show file tree
Hide file tree
Showing 13 changed files with 209 additions and 145 deletions.
26 changes: 7 additions & 19 deletions .github/workflows/automatic-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
- name: Setup PHP
uses: shivammathur/setup-php@cb8f453143149404c7fd670b5f37c91d395b3054
with:
php-version: 7.4
php-version: 8.1
extensions: intl, gd, opcache, mysql, pdo_mysql, soap, zip, :xdebug
coverage: none

Expand Down Expand Up @@ -63,40 +63,28 @@ jobs:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}

- name: Build and push docker image
- name: Build and push standard docker image
uses: docker/build-push-action@v4
with:
push: true
context: ./docker
context: ./
file: ./docker/Dockerfile.build
build-args: |
SOLIDINVOICE_VERSION=${{ github.event.milestone.title }}
tags: |
solidinvoice/solidinvoice:latest
solidinvoice/solidinvoice:${{ github.event.milestone.title }}
- name: Create Merge-Up Pull Request
uses: laminas/automatic-releases@v1
with:
command-name: laminas:automatic-releases:create-merge-up-pull-request

- name: Login to DockerHub
uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}

- name: Build and push docker image
- name: Build and push full docker image
uses: docker/build-push-action@v4
with:
push: true
context: ./docker
file: ./docker/Dockerfile.build
context: ./
file: ./docker/Dockerfile.full-build
build-args: |
SOLIDINVOICE_VERSION=${{ github.event.milestone.title }}
tags: |
solidinvoice/solidinvoice:latest
solidinvoice/solidinvoice:${{ github.event.milestone.title }}
solidinvoice/solidinvoice:${{ github.event.milestone.title }}-full
- name: Create Merge-Up Pull Request
uses: laminas/automatic-releases@1b61a5fcf90ba3223c85130b7bc2a7f95311e79c
Expand Down
11 changes: 6 additions & 5 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

113 changes: 42 additions & 71 deletions docker/Dockerfile.build
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"]
34 changes: 34 additions & 0 deletions docker/Dockerfile.full-build
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
36 changes: 0 additions & 36 deletions docker/conf/nginx.conf

This file was deleted.

10 changes: 10 additions & 0 deletions docker/etc/s6-overlay/s6-rc.d/mysql/data/check
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
1 change: 1 addition & 0 deletions docker/etc/s6-overlay/s6-rc.d/mysql/notification-fd
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3
6 changes: 6 additions & 0 deletions docker/etc/s6-overlay/s6-rc.d/mysql/run
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
1 change: 1 addition & 0 deletions docker/etc/s6-overlay/s6-rc.d/mysql/type
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
longrun
Empty file.
9 changes: 0 additions & 9 deletions docker/scripts/run.sh

This file was deleted.

Loading

0 comments on commit 948a7d6

Please sign in to comment.