update with latest build versions, includes custom build for postgres and migrating from v16 to v18
This commit is contained in:
@@ -5,6 +5,11 @@
|
||||
# Build stage - Install dependencies and prepare optimized source
|
||||
FROM python:3.11-slim AS builder
|
||||
|
||||
LABEL org.opencontainers.image.title="BookWyrm Base" \
|
||||
org.opencontainers.image.description="Shared base image for BookWyrm social reading platform" \
|
||||
org.opencontainers.image.source="https://github.com/bookwyrm-social/bookwyrm" \
|
||||
org.opencontainers.image.vendor="Keyboard Vagabond"
|
||||
|
||||
# Install build dependencies in a single layer
|
||||
RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||
git \
|
||||
@@ -32,11 +37,11 @@ RUN python3 -m venv /opt/venv \
|
||||
|
||||
# Remove unnecessary files from source to reduce image size
|
||||
# Note: .dockerignore will exclude __pycache__, *.pyc, etc. automatically
|
||||
# Note: Keep /app/locale for i18n support (translations)
|
||||
RUN rm -rf \
|
||||
/app/.github \
|
||||
/app/docker \
|
||||
/app/nginx \
|
||||
/app/locale \
|
||||
/app/bw-dev \
|
||||
/app/bookwyrm/tests \
|
||||
/app/bookwyrm/test* \
|
||||
@@ -60,9 +65,9 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||
libpq5 \
|
||||
curl \
|
||||
gettext \
|
||||
&& rm -rf /var/lib/apt/lists/* \
|
||||
&& apt-get autoremove -y \
|
||||
&& apt-get clean \
|
||||
&& apt-get autoremove -y
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# Create bookwyrm user for security
|
||||
RUN useradd --create-home --shell /bin/bash --uid 1000 bookwyrm
|
||||
|
||||
Reference in New Issue
Block a user