Skip to content

Commit

Permalink
Merge pull request #7 from mhzawadi/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
mhzawadi authored Nov 14, 2021
2 parents 82992ec + d50979d commit afad702
Show file tree
Hide file tree
Showing 6 changed files with 62 additions and 51 deletions.
26 changes: 26 additions & 0 deletions .github/workflows/image-dev.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: build our image for dev

on:
push:
branches: dev

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: checkout code
uses: actions/checkout@v2
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: install buildx
id: buildx
uses: docker/setup-buildx-action@v1
- name: Available platforms
run: echo ${{ steps.buildx.outputs.platforms }}
- name: login to docker hub
run: echo "${{ secrets.DOCKER_PASSWORD }}" | docker login -u "${{ secrets.DOCKER_USERNAME }}" --password-stdin
- name: build the image
run: |
docker buildx build --push \
--tag mhzawadi/invoiceplane:dev \
--platform linux/amd64,linux/arm64,linux/arm/v7 .
33 changes: 13 additions & 20 deletions .github/workflows/image-latest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,26 +8,19 @@ jobs:
docker:
runs-on: ubuntu-latest
steps:
-
name: Checkout
- name: checkout code
uses: actions/checkout@v2
-
name: Set up QEMU
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
-
name: Set up Docker Buildx
- name: install buildx
id: buildx
uses: docker/setup-buildx-action@v1
-
name: Login to DockerHub
uses: docker/login-action@v1
with:
username: "${{ secrets.DOCKER_USERNAME }}"
password: "${{ secrets.DOCKER_PASSWORD }}"
-
name: Build and push
uses: docker/build-push-action@v2
with:
context: .
platforms: linux/amd64,linux/arm/v7,linux/arm64
push: true
tags: mhzawadi/invoiceplane:latest
- name: Available platforms
run: echo ${{ steps.buildx.outputs.platforms }}
- name: login to docker hub
run: echo "${{ secrets.DOCKER_PASSWORD }}" | docker login -u "${{ secrets.DOCKER_USERNAME }}" --password-stdin
- name: build the image
run: |
docker buildx build --push \
--tag mhzawadi/invoiceplane:latest \
--platform linux/amd64,linux/arm64,linux/arm/v7 .
41 changes: 17 additions & 24 deletions .github/workflows/image-version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,31 +9,24 @@ jobs:
docker:
runs-on: ubuntu-latest
steps:
- name: checkout code
uses: actions/checkout@v2
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: install buildx
id: buildx
uses: docker/setup-buildx-action@v1
- name: Available platforms
run: echo ${{ steps.buildx.outputs.platforms }}
- name: Prepare
id: prepare
run: |
VERSION=${GITHUB_REF#refs/tags/v}
echo ::set-output name=version::${VERSION}
-
name: Checkout
uses: actions/checkout@v2
-
name: Set up QEMU
uses: docker/setup-qemu-action@v1
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
-
name: Login to DockerHub
uses: docker/login-action@v1
with:
username: "${{ secrets.DOCKER_USERNAME }}"
password: "${{ secrets.DOCKER_PASSWORD }}"
-
name: Build and push
uses: docker/build-push-action@v2
with:
context: .
platforms: linux/amd64,linux/arm/v7,linux/arm64
push: true
tags: mhzawadi/invoiceplane:${{ steps.prepare.outputs.version }}
echo ::set-output name=version::${VERSION}
- name: login to docker hub
run: echo "${{ secrets.DOCKER_PASSWORD }}" | docker login -u "${{ secrets.DOCKER_USERNAME }}" --password-stdin
- name: build the image
run: |
docker buildx build --push \
--tag "mhzawadi/invoiceplane:${{ steps.prepare.outputs.version }}" \
--platform linux/amd64,linux/arm64,linux/arm/v7 .
7 changes: 4 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
FROM alpine:3.13.6
FROM alpine:3.14
MAINTAINER Matthew Horwood <matt@horwood.biz>

RUN apk update \
&& apk add nginx php7-fpm php7-curl php7-dom php7-xml php7-xmlwriter \
php7-tokenizer php7-simplexml php7-gd php7-gmp php7-gettext php7-pcntl \
php7-mysqli php7-sockets php7-ctype php7-pecl-mcrypt php7-xmlrpc \
php7-session composer \
php7-session composer curl\
&& rm -f /var/cache/apk/* \
&& mkdir -p /var/www/html/ \
&& mkdir -p /run/nginx;
Expand All @@ -29,6 +29,7 @@ RUN unzip /tmp/${IP_VERSION}.zip && \
chmod +x /config/start.sh; \
cp /config/php.ini /etc/php7/php.ini && \
cp /config/php_fpm_site.conf /etc/php7/php-fpm.d/www.conf; \
cp /config/nginx_site.conf /etc/nginx/http.d/default.conf; \
chown nobody:nginx /var/www/html/* -R;

VOLUME /var/www/html/uploads
Expand All @@ -37,5 +38,5 @@ ENTRYPOINT ["/config/start.sh"]
CMD ["nginx", "-g", "daemon off;"]

## Health Check
HEALTHCHECK --interval=5m --timeout=3s --start-period=5s \
HEALTHCHECK --interval=1m --timeout=3s --start-period=5s \
CMD curl -f http://127.0.0.1/index.php || exit 1
5 changes: 2 additions & 3 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,10 @@ volumes:

services:
proxyv2:
image: traefik:v2.0 # The official Traefik docker image
image: traefik:v2.5 # The official Traefik docker image
command:
- "--api.insecure=true"
- "--providers.docker"
- "--providers.docker.swarmMode=true"
ports:
- "80:80" # The HTTP port
- "443:443" # The HTTP port
Expand All @@ -22,7 +21,7 @@ services:
labels:
- "traefik.enable=false"
invoiceplane:
image: mhzawadi/invoiceplane:v1.5.10.2
image: mhzawadi/invoiceplane:latest
volumes:
- invoiceplane_data:/var/www/html/uploads
environment:
Expand Down
1 change: 0 additions & 1 deletion setup/start.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#!/bin/sh

cp /config/nginx_site.conf /etc/nginx/conf.d/default.conf
ln -s /dev/stdout /var/log/php7/error.log
ln -s /dev/stdout /var/log/nginx/access.log
ln -s /dev/stdout /var/log/nginx/error.log
Expand Down

0 comments on commit afad702

Please sign in to comment.