-
Notifications
You must be signed in to change notification settings - Fork 56
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #23 from chatons-libreon/master
Dockerize signaturepdf
- Loading branch information
Showing
5 changed files
with
133 additions
and
0 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 |
---|---|---|
@@ -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 }} |
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,22 @@ | ||
FROM php:7.4-apache | ||
|
||
ENV SERVERNAME=localhost | ||
ENV UPLOAD_MAX_FILESIZE=24M | ||
ENV POST_MAX_SIZE=24M | ||
ENV MAX_FILE_UPLOADS=201 | ||
|
||
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 && \ | ||
envsubst < /usr/local/signaturepdf/php.ini > /usr/local/etc/php/conf.d/uploads.ini && \ | ||
envsubst < /usr/local/signaturepdf/apache.conf > /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 && \ | ||
envsubst < /usr/local/signaturepdf/php.ini > /usr/local/etc/php/conf.d/uploads.ini && \ | ||
chown -R www-data:www-data /usr/local/signaturepdf && chmod 750 -R /usr/local/signaturepdf && \ | ||
apache2-foreground |
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,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> |
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 @@ | ||
upload_max_filesize = $UPLOAD_MAX_FILESIZE | ||
post_max_size = $POST_MAX_SIZE | ||
max_file_uploads = $MAX_FILE_UPLOADS |