Skip to content
Snippets Groups Projects
Unverified Commit 41763bd3 authored by Ashish Bhatia's avatar Ashish Bhatia Committed by GitHub
Browse files

Minor lint improvements to Dockerfiles (#12570)

parent 65a3fa39
No related branches found
No related tags found
No related merge requests found
FROM postgres:latest FROM postgres:latest
RUN apt update && \ RUN apt-get update -y && \
apt install -y git make gcc postgresql-16-pgvector apt-get install -y git make gcc postgresql-16-pgvector
...@@ -5,10 +5,9 @@ WORKDIR /app ...@@ -5,10 +5,9 @@ WORKDIR /app
ENV POETRY_VERSION=1.7.1 ENV POETRY_VERSION=1.7.1
# Install libraries for necessary python package builds # Install libraries for necessary python package builds
RUN apt-get update && apt-get install build-essential python3-dev libpq-dev -y RUN apt-get update && apt-get --no-install-recommends install build-essential python3-dev libpq-dev -y && \
pip install --no-cache-dir --upgrade pip && \
RUN pip install --upgrade pip pip install --no-cache-dir --upgrade poetry==${POETRY_VERSION}
RUN pip install --upgrade poetry==${POETRY_VERSION}
# Configure Poetry # Configure Poetry
ENV POETRY_CACHE_DIR=/tmp/poetry_cache ENV POETRY_CACHE_DIR=/tmp/poetry_cache
...@@ -23,7 +22,9 @@ RUN poetry install --no-cache --no-root ...@@ -23,7 +22,9 @@ RUN poetry install --no-cache --no-root
FROM --platform=linux/amd64 python:3.10-slim as runtime FROM --platform=linux/amd64 python:3.10-slim as runtime
RUN apt-get update && apt-get install libpq5 -y && rm -rf /var/lib/apt/lists/* # Install libpq for psycopg2 RUN apt-get update -y && \
apt-get install --no-install-recommends libpq5 -y && \
rm -rf /var/lib/apt/lists/* # Install libpq for psycopg2
RUN groupadd -r appuser && useradd --no-create-home -g appuser -r appuser RUN groupadd -r appuser && useradd --no-create-home -g appuser -r appuser
USER appuser USER appuser
......
...@@ -5,10 +5,9 @@ WORKDIR /app ...@@ -5,10 +5,9 @@ WORKDIR /app
ENV POETRY_VERSION=1.7.1 ENV POETRY_VERSION=1.7.1
# Install libraries for necessary python package builds # Install libraries for necessary python package builds
RUN apt-get update && apt-get install build-essential python3-dev libpq-dev -y RUN apt-get update && apt-get install --no-install-recommends build-essential python3-dev libpq-dev -y && \
pip install --no-cache-dir --upgrade pip && \
RUN pip install --upgrade pip pip install --no-cache-dir --upgrade poetry==${POETRY_VERSION}
RUN pip install --upgrade poetry==${POETRY_VERSION}
# Configure Poetry # Configure Poetry
ENV POETRY_CACHE_DIR=/tmp/poetry_cache ENV POETRY_CACHE_DIR=/tmp/poetry_cache
...@@ -23,7 +22,9 @@ RUN poetry install --no-cache --no-root ...@@ -23,7 +22,9 @@ RUN poetry install --no-cache --no-root
FROM --platform=linux/amd64 python:3.10-slim as runtime FROM --platform=linux/amd64 python:3.10-slim as runtime
RUN apt-get update && apt-get install libpq5 -y && rm -rf /var/lib/apt/lists/* # Install libpq for psycopg2 RUN apt-get update && \
apt-get install --no-install-recommends libpq5 -y && \
rm -rf /var/lib/apt/lists/* # Install libpq for psycopg2
RUN groupadd -r appuser && useradd --no-create-home -g appuser -r appuser RUN groupadd -r appuser && useradd --no-create-home -g appuser -r appuser
USER appuser USER appuser
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment