Compare commits

...

2 Commits

Author SHA1 Message Date
Daniel Wolf 6dd1c85ede
we have no more testing branch
continuous-integration/drone/push Build is passing Details
2022-04-20 17:06:42 -04:00
Daniel Wolf c1b5bae86a
use multi-stage build 2022-04-20 17:06:13 -04:00
3 changed files with 40 additions and 25 deletions

View File

@ -9,19 +9,37 @@ platform:
steps:
- name: build
environment:
PDR_USER:
from_secret: docker-user-pdr
PDR_PASS:
from_secret: docker-pass-pdr
commands:
- docker build -t pdr.nephatrine.net/nephatrine/nginx-h5ai:cached --target builder .
- docker build -t pdr.nephatrine.net/nephatrine/nginx-h5ai:latest .
- HOME=/mnt/config/home docker push pdr.nephatrine.net/nephatrine/nginx-h5ai:latest
- docker login -p "$PDR_PASS" -u "$PDR_USER" pdr.nephatrine.net
- docker push pdr.nephatrine.net/nephatrine/nginx-h5ai:latest
- docker logout pdr.nephatrine.net
- name: publish
environment:
DOCKER_USER:
from_secret: docker-user
DOCKER_PASS:
from_secret: docker-pass
commands:
- docker tag pdr.nephatrine.net/nephatrine/nginx-h5ai:latest nephatrine/nginx-h5ai:latest
- HOME=/mnt/config/home docker push nephatrine/nginx-h5ai:latest
- docker rmi pdr.nephatrine.net/nephatrine/nginx-h5ai:latest
- docker login -p "$DOCKER_PASS" -u "$DOCKER_USER"
- docker push -a nephatrine/nginx-h5ai
- docker logout
depends_on:
- build
---
kind: pipeline
name: after
name: notify
steps:
- name: notify
- name: notify-status
image: appleboy/drone-discord
failure: ignore
settings:
@ -43,6 +61,6 @@ trigger:
---
kind: signature
hmac: c1a0be4377b47332d7e041007b00acd6af46154477676330dcd5ac8e0a85c823
hmac: d7774cd61d67081b28130ce74c567ec5045e030e95dd5df70f810ef3d9ce5039
...

View File

@ -1,24 +1,22 @@
FROM nephatrine/nginx-php:latest
FROM pdr.nephatrine.net/nephatrine/alpine-builder:latest AS builder
ARG H5AI_VERSION=0.31.0
RUN git -C /usr/src clone -b "$H5AI_VERSION" --single-branch --depth=1 https://github.com/glubsy/h5ai.git
RUN echo "====== COMPILE H5AI ======" \
&& cd /usr/src/h5ai \
&& npm install && npm run build \
&& mkdir -p /var/www/html/ \
&& unzip build/*.zip -d /var/www/html/
FROM pdr.nephatrine.net/nephatrine/nginx-php:latest
LABEL maintainer="Daniel Wolf <nephatrine@gmail.com>"
RUN echo "====== INSTALL TOOLS ======" \
&& apk add --no-cache \
ffmpeg \
imagemagick \
zip \
&& apk add --no-cache ffmpeg imagemagick zip \
&& sed -i 's~/mnt/config/www/~/mnt/config/www/:/mnt/media/~g' /etc/php/php-fpm.d/www.conf \
&& sed -i 's~index.html~index.html /_h5ai/public/index.php~g' /etc/nginx/nginx.conf
ARG H5AI_VERSION=0.31.0
RUN echo "====== COMPILE H5AI ======" \
&& apk add --no-cache --virtual .build-h5ai \
git \
npm \
&& git -C /usr/src clone -b "$H5AI_VERSION" --single-branch --depth=1 https://github.com/glubsy/h5ai.git && cd /usr/src/h5ai \
&& npm install && npm run build \
&& unzip build/*.zip -d /var/www/html/ \
&& mkdir -p /mnt/media \
&& cd /usr/src && rm -rf /usr/src/* \
&& apk del --purge .build-h5ai
&& sed -i 's~index.html~index.html /_h5ai/public/index.php~g' /etc/nginx/nginx.conf \
&& mkdir -p /mnt/media
COPY --from=builder /var/www/html/ /var/www/html/
COPY override /

View File

@ -40,7 +40,6 @@ applications.
## Docker Tags
- **nephatrine/nginx-h5ai:testing**: H5AI 0.31.0-glubsy / PHP 8.x / NGINX Mainline / Alpine Edge
- **nephatrine/nginx-h5ai:latest**: H5AI 0.31.0-glubsy / PHP 8.x / NGINX Mainline / Alpine Latest
## Configuration Variables