2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-06-14 11:05:41 +00:00

[Docker] Alpine image fix (#9118)

* Revert to alpine3:20 / postgres:16

* Remove old hack

- No longer needed as we are using python 3.11

* Update package requirements for devcontainer

Also fixes some docker warnings from the alpine Dockerfile

* Specify SITE_URL

* Reduce log output during docker image testing
This commit is contained in:
Oliver
2025-02-21 18:02:39 +11:00
committed by GitHub
parent 96bca652c4
commit 15ad62494f
7 changed files with 17 additions and 24 deletions

View File

@ -9,8 +9,7 @@
# - Runs InvenTree web server under django development server
# - Monitors source files for any changes, and live-reloads server
FROM python:3.11-alpine3.21 AS inventree_base
ARG base_image
FROM python:3.11-alpine3.20 AS inventree_base
# Build arguments for this image
ARG commit_tag=""
@ -19,8 +18,8 @@ ARG commit_date=""
ARG data_dir="data"
ENV PYTHONUNBUFFERED 1
ENV PIP_DISABLE_PIP_VERSION_CHECK 1
ENV PYTHONUNBUFFERED=1
ENV PIP_DISABLE_PIP_VERSION_CHECK=1
ENV INVOKE_RUN_SHELL="/bin/ash"
ENV INVENTREE_DOCKER="true"
@ -48,8 +47,7 @@ ENV INVENTREE_BACKGROUND_WORKERS="4"
ENV INVENTREE_WEB_ADDR=0.0.0.0
ENV INVENTREE_WEB_PORT=8000
LABEL org.opencontainers.image.created=${DATE} \
org.opencontainers.image.vendor="inventree" \
LABEL org.opencontainers.image.vendor="inventree" \
org.opencontainers.image.title="InvenTree backend server" \
org.opencontainers.image.description="InvenTree is the open-source inventory management system" \
org.opencontainers.image.url="https://inventree.org" \
@ -57,7 +55,6 @@ LABEL org.opencontainers.image.created=${DATE} \
org.opencontainers.image.source="https://github.com/inventree/InvenTree" \
org.opencontainers.image.revision=${commit_hash} \
org.opencontainers.image.licenses="MIT" \
org.opencontainers.image.base.name="docker.io/library/${base_image}" \
org.opencontainers.image.version=${commit_tag}
@ -68,8 +65,8 @@ RUN apk add --no-cache \
libjpeg libwebp zlib \
# Weasyprint requirements : https://doc.courtbouillon.org/weasyprint/stable/first_steps.html#alpine-3-12
py3-pip py3-pillow py3-cffi py3-brotli pango poppler-utils openldap \
# Postgres client (note: backwards compatible with postgres server <= 17)
postgresql17-client \
# Postgres client (note: backwards compatible with postgres server <= 16)
postgresql16-client \
# MySQL / MariaDB client
mariadb-client mariadb-connector-c \
&& \

View File

@ -1,9 +1,11 @@
# InvenTree environment variables for a development setup
# These variables will be used by the docker-compose.yml file
INVENTREE_SITE_URL=http://localhost:8000
# Set DEBUG to True for a development setup
INVENTREE_DEBUG=True
INVENTREE_LOG_LEVEL=INFO
INVENTREE_LOG_LEVEL=WARNING
INVENTREE_DB_LOGGING=False
# Database configuration options

View File

@ -1,12 +1,11 @@
#!/bin/ash
# Install system packages required for building InvenTree python libraries
# Note that for postgreslql, we use the version 13, which matches the version used in the InvenTree docker image
apk add gcc g++ musl-dev openssl-dev libffi-dev cargo python3-dev openldap-dev \
libstdc++ build-base linux-headers py3-grpcio \
jpeg-dev openjpeg-dev libwebp-dev zlib-dev \
sqlite sqlite-dev \
mariadb-connector-c-dev mariadb-client mariadb-dev \
postgresql17-dev postgresql-libs \
postgresql16-dev postgresql-libs \
$@