Update docker images

This commit is contained in:
Sonny Bakker 2024-08-24 14:39:10 +02:00
parent 4935d7d186
commit 35c9e78809
2 changed files with 13 additions and 16 deletions

View file

@ -1,7 +1,7 @@
# stage 1 # stage 1
FROM python:3.9-bullseye as backend FROM python:3.11-bookworm as backend
RUN apt-get update && apt-get install -y --no-install-recommends \ RUN apt-get update && apt-get install --yes --no-install-recommends \
vim \ vim \
curl \ curl \
gettext \ gettext \
@ -14,15 +14,12 @@ RUN mkdir /app/media
COPY ./requirements /app/requirements COPY ./requirements /app/requirements
RUN pip install -r requirements/base.txt RUN pip install uv
RUN uv pip install --requirement requirements/base.txt
# stage 2 # stage 2
FROM node:16-bullseye AS frontend-build FROM node:lts AS frontend-build
RUN apt-get update && apt-get install -y --no-install-recommends \
git \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /app WORKDIR /app
@ -36,9 +33,9 @@ RUN npm run build:prod
# stage 3 # stage 3
FROM python:3.9-bullseye as production FROM python:3.11-bookworm as production
RUN apt-get update && apt-get install -y --no-install-recommends \ RUN apt-get update && apt-get install --yes --no-install-recommends \
postgresql-client \ postgresql-client \
vim \ vim \
curl \ curl \
@ -51,7 +48,7 @@ RUN mkdir /app/logs
RUN mkdir /app/media RUN mkdir /app/media
RUN mkdir /app/bin RUN mkdir /app/bin
COPY --from=backend /usr/local/lib/python3.9 /usr/local/lib/python3.9 COPY --from=backend /usr/local/lib/python3.11 /usr/local/lib/python3.11
COPY --from=backend /usr/local/bin/celery /usr/local/bin/celery COPY --from=backend /usr/local/bin/celery /usr/local/bin/celery
COPY ./bin/docker-entrypoint.sh /app/bin/docker-entrypoint.sh COPY ./bin/docker-entrypoint.sh /app/bin/docker-entrypoint.sh
@ -62,7 +59,7 @@ COPY ./src /app/src
COPY ./requirements /app/requirements COPY ./requirements /app/requirements
RUN pip install -r requirements/production.txt RUN uv pip install --requirement requirements/production.txt
RUN useradd -M -u 1000 newsreader RUN useradd -M -u 1000 newsreader
RUN chown -R newsreader:newsreader /app RUN chown -R newsreader:newsreader /app
@ -84,9 +81,9 @@ RUN python src/manage.py collectstatic --noinput
# (optional) stage 4 # (optional) stage 4
FROM python:3.9-bullseye as development FROM python:3.11-bookworm as development
RUN apt-get update && apt-get install -y --no-install-recommends \ RUN apt-get update && apt-get install --yes --no-install-recommends \
vim \ vim \
curl \ curl \
&& rm -rf /var/lib/apt/lists/* && rm -rf /var/lib/apt/lists/*
@ -103,7 +100,7 @@ COPY --from=backend /usr/local/lib/python3.9 /usr/local/lib/python3.9
COPY --from=backend /usr/local/bin/celery /usr/local/bin/celery COPY --from=backend /usr/local/bin/celery /usr/local/bin/celery
COPY --from=backend /app/src/ /app/src/ COPY --from=backend /app/src/ /app/src/
RUN pip install -r requirements/development.txt RUN uv pip install --requirement requirements/development.txt
RUN useradd -M -u 1000 newsreader RUN useradd -M -u 1000 newsreader
RUN chown -R newsreader:newsreader /app RUN chown -R newsreader:newsreader /app

View file

@ -1,4 +1,4 @@
FROM node:16-bullseye FROM node:lts
WORKDIR /app WORKDIR /app
RUN mkdir /app/src RUN mkdir /app/src