Merge pull request #2 from Jafner/uid-gid-env

Resolves #2
This commit is contained in:
Jafner 2021-09-09 14:52:33 -07:00 committed by GitHub
commit ee7392d5f1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 47 additions and 1 deletions

41
.github/workflows/feature.yml vendored Normal file
View File

@ -0,0 +1,41 @@
# This is a basic workflow to help you get started with Actions
name: Feature 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 Docker image
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 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 }}

View File

@ -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"]

View File

@ -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