mirror of
https://github.com/retspen/webvirtcloud
synced 2026-10-18 00:50:07 +00:00
fix(docker): resolve hadolint warnings in Dockerfile and add hadolint config
This commit is contained in:
parent
7435d66492
commit
f061189716
3 changed files with 15 additions and 3 deletions
5
.github/linters/.hadolint.yaml
vendored
Normal file
5
.github/linters/.hadolint.yaml
vendored
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
ignored:
|
||||
- DL3008
|
||||
- DL3013
|
||||
- DL3042
|
||||
- SC1091
|
||||
5
.hadolint.yaml
Normal file
5
.hadolint.yaml
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
ignored:
|
||||
- DL3008
|
||||
- DL3013
|
||||
- DL3042
|
||||
- SC1091
|
||||
|
|
@ -8,6 +8,7 @@ CMD ["/sbin/my_init"]
|
|||
|
||||
RUN echo 'APT::Get::Clean=always;' >> /etc/apt/apt.conf.d/99AutomaticClean
|
||||
|
||||
# hadolint ignore=DL3008
|
||||
RUN apt-get update -qqy \
|
||||
&& DEBIAN_FRONTEND=noninteractive apt-get -qyy install \
|
||||
--no-install-recommends \
|
||||
|
|
@ -33,16 +34,17 @@ WORKDIR /srv/webvirtcloud
|
|||
|
||||
# Install Python dependencies first with system-site-packages to leverage prebuilt bindings
|
||||
COPY conf/requirements.txt conf/requirements.txt
|
||||
# hadolint ignore=DL3013,DL3042,SC1091
|
||||
RUN python3 -m venv --system-site-packages venv && \
|
||||
. venv/bin/activate && \
|
||||
pip3 install -U pip wheel && \
|
||||
pip3 install -r conf/requirements.txt && \
|
||||
pip3 cache purge
|
||||
pip3 install --no-cache-dir -U pip wheel && \
|
||||
pip3 install --no-cache-dir -r conf/requirements.txt
|
||||
|
||||
# Copy application source
|
||||
COPY . /srv/webvirtcloud
|
||||
|
||||
# Run collectstatic with temporary dummy key, then remove temporary settings file
|
||||
# hadolint ignore=SC1091
|
||||
RUN . venv/bin/activate && \
|
||||
cp webvirtcloud/settings.py.template webvirtcloud/settings.py && \
|
||||
SECRET_KEY="build-dummy-key-only-for-collectstatic" python3 manage.py collectstatic --noinput && \
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue