Skip to content

Commit

Permalink
Avoid security issues
Browse files Browse the repository at this point in the history
  • Loading branch information
filipopo committed Dec 18, 2024
1 parent c155823 commit 511e3d1
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ RUN pip install --no-cache-dir --upgrade -r requirements.txt
COPY app .

RUN python manage.py collectstatic --noinput && \
apt update && apt install -y minify && \
apt update && apt install --no-install-recommends -y minify && \
minify -r prod_static -o . && \
apt clean && rm -rf /var/lib/apt/lists/* webapp/static requirements*.txt

Expand All @@ -23,7 +23,7 @@ FROM base_default AS base_mssql
ONBUILD COPY app/requirements-mssql.txt .

ONBUILD RUN pip install --no-cache-dir --upgrade -r requirements-mssql.txt && \
apt update && apt install -y curl gpg && \
apt update && apt install --no-install-recommends -y curl gpg && \
apt clean && rm -rf /var/lib/apt/lists/* requirements*.txt && \
VER=$(cut -d. -f1 /etc/debian_version) && \
curl -fsSL https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor -o /usr/share/keyrings/microsoft-prod.gpg && \
Expand Down Expand Up @@ -58,15 +58,15 @@ ONBUILD COPY --from=base /usr/share/keyrings/microsoft-prod.gpg /usr/share/keyri
ONBUILD COPY --from=base /etc/apt/sources.list.d/mssql-release.list /etc/apt/sources.list.d/mssql-release.list

# FixMe: remove libgssapi-krb5-2 once microsoft updates mssql-django & msodbcsql17
ONBUILD RUN apt update && ACCEPT_EULA=y apt install -y unixodbc msodbcsql17 libgssapi-krb5-2 && \
ONBUILD RUN apt update && ACCEPT_EULA=y apt install --no-install-recommends -y libgssapi-krb5-2 msodbcsql17 unixodbc && \
apt clean && rm -rf /var/lib/apt/lists/*


FROM build_default AS build_nginx

ONBUILD ENV BUILD=nginx

ONBUILD RUN apt update && apt install -y nginx && \
ONBUILD RUN apt update && apt install --no-install-recommends -y nginx && \
apt clean && rm -rf /var/lib/apt/lists/*

ONBUILD COPY --from=base /home/default /etc/nginx/sites-available/default
Expand Down

0 comments on commit 511e3d1

Please sign in to comment.