1
0
Fork 0
mirror of https://github.com/24eme/signaturepdf synced 2024-04-26 03:20:30 +02:00

ci: dockerize and push with gh-actions

This commit is contained in:
xgaia 2022-01-28 17:23:51 +01:00
parent 2f834f6ba6
commit 1f0022b6e1
4 changed files with 97 additions and 0 deletions

54
.github/workflows/docker.yaml vendored Normal file
View file

@ -0,0 +1,54 @@
name: Docker publish
on:
push:
branches:
- 'master'
tags:
- '*.*.*'
jobs:
docker:
environment: docker-registry
runs-on: ubuntu-latest
steps:
-
name: Checkout
uses: actions/checkout@v2
-
name: Docker meta
id: meta
uses: docker/metadata-action@v3
with:
# list of Docker images to use as base name for tags
images: registry.hub.docker.com/${{ secrets.DOCKER_REGISTRY_USERNAME }}/signaturepdf
# generate Docker tags based on the following events/attributes
tags: |
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
-
name: Set up QEMU
uses: docker/setup-qemu-action@v1
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
-
name: Login to registry
uses: docker/login-action@v1
with:
registry: registry.hub.docker.com
username: xgaia
password: ${{ secrets.DOCKER_REGISTRY_TOKEN }}
-
name: Build and push
uses: docker/build-push-action@v2
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
secrets: |
GIT_AUTH_TOKEN=${{ secrets.DOCKER_REGISTRY_TOKEN }}

18
Dockerfile Normal file
View file

@ -0,0 +1,18 @@
FROM php:7.4-apache
ENV SERVERNAME=localhost
RUN apt update && apt install -y gettext-base librsvg2-bin pdftk imagemagick potrace
COPY . /usr/local/signaturepdf
RUN chown -R www-data:www-data /usr/local/signaturepdf && chmod 750 -R /usr/local/signaturepdf && \
cp /usr/local/signaturepdf/php.ini /usr/local/etc/php/conf.d/uploads.ini && \
cat /usr/local/signaturepdf/apache.conf | envsubst > /etc/apache2/sites-available/signaturepdf.conf && \
a2enmod rewrite && a2ensite signaturepdf
WORKDIR /usr/local/signaturepdf
CMD envsubst < /usr/local/signaturepdf/apache.conf > /etc/apache2/sites-available/signaturepdf.conf && \
chown -R www-data:www-data /usr/local/signaturepdf && chmod 750 -R /usr/local/signaturepdf && \
apache2-foreground

22
apache.conf Normal file
View file

@ -0,0 +1,22 @@
<VirtualHost *:80>
ServerName ${SERVERNAME}
DocumentRoot /usr/local/signaturepdf/public
DirectoryIndex index.php
AddDefaultCharset UTF-8
<Directory /usr/local/signaturepdf/public>
AllowOverride All
<IfVersion >= 2.3>
Require all granted
</IfVersion>
<IfVersion < 2.3>
Order Deny,Allow
Allow from all
</IfVersion>
</Directory>
LogLevel warn
ErrorLog /var/log/apache2/ssp_error.log
CustomLog /var/log/apache2/ssp_access.log combined
</VirtualHost>

3
php.ini Normal file
View file

@ -0,0 +1,3 @@
upload_max_filesize = 24M
post_max_size = 24M
max_file_uploads = 201