mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-04-02 13:45:10 -05:00
Merge pull request #1259 from paperless-ngx/chore-add-ci-hadolint
Chore: Add Hadolint job to CI
This commit is contained in:
commit
f4be2e4fe7
21
.github/workflows/reusable-ci-backend.yml
vendored
21
.github/workflows/reusable-ci-backend.yml
vendored
@ -106,3 +106,24 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
cd src/
|
cd src/
|
||||||
pipenv run coveralls --service=github
|
pipenv run coveralls --service=github
|
||||||
|
|
||||||
|
dockerfile-lint:
|
||||||
|
name: "Lint ${{ matrix.dockerfile }}"
|
||||||
|
runs-on: ubuntu-20.04
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
dockerfile:
|
||||||
|
- Dockerfile
|
||||||
|
- docker-builders/Dockerfile.qpdf
|
||||||
|
- docker-builders/Dockerfile.jbig2enc
|
||||||
|
- docker-builders/Dockerfile.psycopg2
|
||||||
|
- docker-builders/Dockerfile.pikepdf
|
||||||
|
fail-fast: false
|
||||||
|
steps:
|
||||||
|
-
|
||||||
|
name: Checkout
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
-
|
||||||
|
uses: hadolint/hadolint-action@v2.1.0
|
||||||
|
with:
|
||||||
|
dockerfile: ${{ matrix.dockerfile }}
|
||||||
|
8
.hadolint.yml
Normal file
8
.hadolint.yml
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
failure-threshold: warning
|
||||||
|
ignored:
|
||||||
|
# https://github.com/hadolint/hadolint/wiki/DL3008
|
||||||
|
- DL3008
|
||||||
|
# https://github.com/hadolint/hadolint/wiki/DL3013
|
||||||
|
- DL3013
|
||||||
|
# https://github.com/hadolint/hadolint/wiki/DL3003
|
||||||
|
- DL3003
|
@ -74,13 +74,6 @@ repos:
|
|||||||
rev: v2.10.0
|
rev: v2.10.0
|
||||||
hooks:
|
hooks:
|
||||||
- id: hadolint
|
- id: hadolint
|
||||||
args:
|
|
||||||
- --ignore
|
|
||||||
- DL3008 # https://github.com/hadolint/hadolint/wiki/DL3008 (should probably do this at some point)
|
|
||||||
- --ignore
|
|
||||||
- DL3013 # https://github.com/hadolint/hadolint/wiki/DL3013 (should probably do this too at some point)
|
|
||||||
- --ignore
|
|
||||||
- DL3003 # https://github.com/hadolint/hadolint/wiki/DL3003 (seems excessive to use WORKDIR so much)
|
|
||||||
# Shell script hooks
|
# Shell script hooks
|
||||||
- repo: https://github.com/lovesegfault/beautysh
|
- repo: https://github.com/lovesegfault/beautysh
|
||||||
rev: v6.2.1
|
rev: v6.2.1
|
||||||
|
27
Dockerfile
27
Dockerfile
@ -117,19 +117,18 @@ COPY gunicorn.conf.py .
|
|||||||
# setup docker-specific things
|
# setup docker-specific things
|
||||||
# Use mounts to avoid copying installer files into the image
|
# Use mounts to avoid copying installer files into the image
|
||||||
# These change sometimes, but rarely
|
# These change sometimes, but rarely
|
||||||
ARG DOCKER_SRC=/usr/src/paperless/src/docker/
|
WORKDIR /usr/src/paperless/src/docker/
|
||||||
WORKDIR ${DOCKER_SRC}
|
|
||||||
|
|
||||||
COPY [ \
|
COPY [ \
|
||||||
"docker/imagemagick-policy.xml", \
|
"docker/imagemagick-policy.xml", \
|
||||||
"docker/supervisord.conf", \
|
"docker/supervisord.conf", \
|
||||||
"docker/docker-entrypoint.sh", \
|
"docker/docker-entrypoint.sh", \
|
||||||
"docker/docker-prepare.sh", \
|
"docker/docker-prepare.sh", \
|
||||||
"docker/paperless_cmd.sh", \
|
"docker/paperless_cmd.sh", \
|
||||||
"docker/wait-for-redis.py", \
|
"docker/wait-for-redis.py", \
|
||||||
"docker/management_script.sh", \
|
"docker/management_script.sh", \
|
||||||
"docker/install_management_commands.sh", \
|
"docker/install_management_commands.sh", \
|
||||||
"${DOCKER_SRC}" \
|
"/usr/src/paperless/src/docker/" \
|
||||||
]
|
]
|
||||||
|
|
||||||
RUN set -eux \
|
RUN set -eux \
|
||||||
@ -162,15 +161,15 @@ RUN --mount=type=bind,from=qpdf-builder,target=/qpdf \
|
|||||||
&& apt-get install --yes --no-install-recommends /qpdf/usr/src/qpdf/libqpdf28_*.deb \
|
&& apt-get install --yes --no-install-recommends /qpdf/usr/src/qpdf/libqpdf28_*.deb \
|
||||||
&& apt-get install --yes --no-install-recommends /qpdf/usr/src/qpdf/qpdf_*.deb \
|
&& apt-get install --yes --no-install-recommends /qpdf/usr/src/qpdf/qpdf_*.deb \
|
||||||
&& echo "Installing pikepdf and dependencies" \
|
&& echo "Installing pikepdf and dependencies" \
|
||||||
|
&& python3 -m pip install --no-cache-dir /pikepdf/usr/src/wheels/pyparsing*.whl \
|
||||||
&& python3 -m pip install --no-cache-dir /pikepdf/usr/src/wheels/packaging*.whl \
|
&& python3 -m pip install --no-cache-dir /pikepdf/usr/src/wheels/packaging*.whl \
|
||||||
&& python3 -m pip install --no-cache-dir /pikepdf/usr/src/wheels/lxml*.whl \
|
&& python3 -m pip install --no-cache-dir /pikepdf/usr/src/wheels/lxml*.whl \
|
||||||
&& python3 -m pip install --no-cache-dir /pikepdf/usr/src/wheels/Pillow*.whl \
|
&& python3 -m pip install --no-cache-dir /pikepdf/usr/src/wheels/Pillow*.whl \
|
||||||
&& python3 -m pip install --no-cache-dir /pikepdf/usr/src/wheels/pyparsing*.whl \
|
|
||||||
&& python3 -m pip install --no-cache-dir /pikepdf/usr/src/wheels/pikepdf*.whl \
|
&& python3 -m pip install --no-cache-dir /pikepdf/usr/src/wheels/pikepdf*.whl \
|
||||||
&& python -m pip list \
|
&& python3 -m pip list \
|
||||||
&& echo "Installing psycopg2" \
|
&& echo "Installing psycopg2" \
|
||||||
&& python3 -m pip install --no-cache-dir /psycopg2/usr/src/wheels/psycopg2*.whl \
|
&& python3 -m pip install --no-cache-dir /psycopg2/usr/src/wheels/psycopg2*.whl \
|
||||||
&& python -m pip list
|
&& python3 -m pip list
|
||||||
|
|
||||||
# Python dependencies
|
# Python dependencies
|
||||||
# Change pretty frequently
|
# Change pretty frequently
|
||||||
|
@ -1,17 +0,0 @@
|
|||||||
FROM python:3.5.1
|
|
||||||
|
|
||||||
# Install Sphinx and Pygments
|
|
||||||
RUN pip install --no-cache-dir Sphinx Pygments \
|
|
||||||
# Setup directories, copy data
|
|
||||||
&& mkdir /build
|
|
||||||
|
|
||||||
COPY . /build
|
|
||||||
WORKDIR /build/docs
|
|
||||||
|
|
||||||
# Build documentation
|
|
||||||
RUN make html
|
|
||||||
|
|
||||||
# Start webserver
|
|
||||||
WORKDIR /build/docs/_build/html
|
|
||||||
EXPOSE 8000/tcp
|
|
||||||
CMD ["python3", "-m", "http.server"]
|
|
Loading…
x
Reference in New Issue
Block a user