From d0b49b8932c2cf151ad381e949a839fa4a6b0f45 Mon Sep 17 00:00:00 2001 From: Jafner <40403594+Jafner@users.noreply.github.com> Date: Thu, 9 Sep 2021 13:20:30 -0700 Subject: [PATCH 1/5] Added PUID and PGID env vars to dockerfile Added chown to dockerfile --- Dockerfile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Dockerfile b/Dockerfile index 07978ea..5c9f41c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,6 @@ FROM httpd +ENV PUID=${PUID:-1000} +ENV PGID=${PGID:-1000} COPY init.sh /init.sh COPY healthcheck.sh /healthcheck.sh RUN apt-get update && \ @@ -8,6 +10,7 @@ chmod +x /init.sh && \ chmod +x /healthcheck.sh WORKDIR /usr/local/apache2/htdocs/ RUN mkdir download +RUN chown -R $PUID:$PGID /usr/local/apache2/htdocs ENV IMG false HEALTHCHECK --start-period=1m CMD /healthcheck.sh CMD ["/bin/bash","/init.sh"] \ No newline at end of file From c1bf4a067a469fbe05cc3c855f5f8f7f4a1704f7 Mon Sep 17 00:00:00 2001 From: Jafner <40403594+Jafner@users.noreply.github.com> Date: Thu, 9 Sep 2021 13:33:07 -0700 Subject: [PATCH 2/5] Add feature.yml Triggers only on non-main branch pushes Does not publish to dockerhub --- .github/workflows/feature.yml | 41 +++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 .github/workflows/feature.yml diff --git a/.github/workflows/feature.yml b/.github/workflows/feature.yml new file mode 100644 index 0000000..a9acf7b --- /dev/null +++ b/.github/workflows/feature.yml @@ -0,0 +1,41 @@ +# This is a basic workflow to help you get started with Actions + +name: CI + +# Controls when the workflow will run +on: + # Triggers the workflow on push or pull request events but only for the main branch + push: + branches-ignore: [ main ] + + + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +# A workflow run is made up of one or more jobs that can run sequentially or in parallel +jobs: + test_build: + name: Build and push Docker image to Docker Hub + runs-on: ubuntu-latest + steps: + - name: Check out the repo + uses: actions/checkout@v2 + + - name: Set up QEMU + uses: docker/setup-qemu-action@master + with: + platforms: all + + - name: Set up Docker Buildx + id: buildx + uses: docker/setup-buildx-action@master + + - name: Build and push the Docker image + uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc + with: + context: . + builder: ${{ steps.buildx.outputs.name }} + platforms: linux/amd64,linux/arm64,linux/arm/v7 + push: false + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} From b9b7eae684aa79a66ae23122d676f3863debf6d3 Mon Sep 17 00:00:00 2001 From: Jafner <40403594+Jafner@users.noreply.github.com> Date: Thu, 9 Sep 2021 13:35:34 -0700 Subject: [PATCH 3/5] Minor renaming of feature branch tests --- .github/workflows/feature.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/feature.yml b/.github/workflows/feature.yml index a9acf7b..5b5432e 100644 --- a/.github/workflows/feature.yml +++ b/.github/workflows/feature.yml @@ -1,6 +1,6 @@ # This is a basic workflow to help you get started with Actions -name: CI +name: Feature CI # Controls when the workflow will run on: @@ -30,7 +30,7 @@ jobs: id: buildx uses: docker/setup-buildx-action@master - - name: Build and push the Docker image + - name: Build the Docker image uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc with: context: . From 45355e745b37f2d33164742e360ba9c24bdba062 Mon Sep 17 00:00:00 2001 From: Jafner <40403594+Jafner@users.noreply.github.com> Date: Thu, 9 Sep 2021 13:36:52 -0700 Subject: [PATCH 4/5] Rename stage of feature ci --- .github/workflows/feature.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/feature.yml b/.github/workflows/feature.yml index 5b5432e..04644a5 100644 --- a/.github/workflows/feature.yml +++ b/.github/workflows/feature.yml @@ -15,7 +15,7 @@ on: # A workflow run is made up of one or more jobs that can run sequentially or in parallel jobs: test_build: - name: Build and push Docker image to Docker Hub + name: Build Docker image runs-on: ubuntu-latest steps: - name: Check out the repo From 1a758476eb13dd198f40294f8c2785b267dc5e51 Mon Sep 17 00:00:00 2001 From: Jafner <40403594+Jafner@users.noreply.github.com> Date: Thu, 9 Sep 2021 14:47:55 -0700 Subject: [PATCH 5/5] Add context-dependence for volumes and UID/GID --- docker-compose.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docker-compose.yml b/docker-compose.yml index ce88182..8a23684 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -4,6 +4,8 @@ services: container_name: 5etools-docker image: joeyhafner/5etools-docker:latest volumes: - - 5etools-docker:/usr/local/apache2/htdocs + - ${PWD}/htdocs:/usr/local/apache2/htdocs # this assumes your docker-compose.yml file is inside a "5etools-docker" directory. environment: - IMG=true + - PUID=${id -u} # this sets the user ID (uid) to that of the user running the command + - PGID=${id -g} # this sets the group ID (gid) to that of the user running the command