Compare commits

..

4 Commits

Author SHA1 Message Date
ed31225d4d Ignore generated zip files 2026-07-06 13:35:55 +02:00
b489b48c0d fix the manager 2026-07-06 13:24:12 +02:00
0572efba8b fix the manager 2026-07-06 12:34:01 +02:00
948f209436 fix the manager 2026-07-06 12:18:41 +02:00
6 changed files with 56 additions and 7 deletions

11
.dockerignore Normal file
View File

@@ -0,0 +1,11 @@
.git
.agents
.codex
__pycache__
*.pyc
*.pyo
.pytest_cache
.DS_Store
docker-run-commands.sh
manager-solution/__pycache__
manager-solution/manager/__pycache__

2
.gitignore vendored Normal file
View File

@@ -0,0 +1,2 @@
maschera.zip
fiscality-installer.zip

View File

@@ -11,10 +11,12 @@ RUN mkdir -p /app /defaults \
RUN ln -snf /usr/share/zoneinfo/Europe/Rome /etc/localtime && \
echo "Europe/Rome" > /etc/timezone
# The base image may include Docker's apt repository, but this image does not
# install Docker packages. Disable it so apt updates do not fail on stale keys.
# The base image may include third-party apt repositories, but this image only
# needs Debian packages. Disable inherited repos so stale keys cannot break apt.
RUN rm -f /etc/apt/sources.list.d/docker.list \
/etc/apt/sources.list.d/download_docker_com_linux_debian.list
/etc/apt/sources.list.d/download_docker_com_linux_debian.list \
/etc/apt/sources.list.d/nodesource.list \
/etc/apt/sources.list.d/nodesource.list.save
RUN apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
@@ -37,7 +39,8 @@ RUN apt-get update && \
&& sed -i 's/# it_IT.UTF-8 UTF-8/it_IT.UTF-8 UTF-8/' /etc/locale.gen \
&& locale-gen it_IT.UTF-8 \
&& update-locale LANG=it_IT.UTF-8 LC_ALL=it_IT.UTF-8 \
&& rm -rf /var/lib/apt/lists/*
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* /var/cache/apt/archives/*.deb
# --- Install Microsoft core fonts (Arial, Times New Roman, Courier New, etc.) ---
@@ -46,8 +49,7 @@ RUN set -eux; \
apt-get install -y --no-install-recommends \
fontconfig \
cabextract \
xfonts-utils \
gnupg; \
xfonts-utils; \
\
sed -i 's/ main$/ main contrib/g' /etc/apt/sources.list; \
apt-get update; \
@@ -56,7 +58,8 @@ RUN set -eux; \
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ttf-mscorefonts-installer; \
\
fc-cache -f -v; \
rm -rf /var/lib/apt/lists/*
apt-get clean; \
rm -rf /var/lib/apt/lists/* /var/cache/apt/archives/*.deb

View File

@@ -12,6 +12,7 @@ SKIP_BUILD="${SKIP_BUILD:-0}"
SKIP_MANAGER_BUILD="${SKIP_MANAGER_BUILD:-0}"
PULL_APP_IMAGE="${PULL_APP_IMAGE:-0}"
PULL_MANAGER_IMAGE="${PULL_MANAGER_IMAGE:-0}"
MIN_DOCKER_FREE_MB="${MIN_DOCKER_FREE_MB:-8192}"
echo "Project root: ${ROOT_DIR}"
echo "Manager dir: ${MANAGER_DIR}"
@@ -32,6 +33,37 @@ ensure_image_exists() {
fi
}
check_docker_free_space() {
local docker_root
docker_root="$(docker info -f '{{.DockerRootDir}}' 2>/dev/null || true)"
if [[ -z "${docker_root}" || ! -d "${docker_root}" ]]; then
echo "Could not determine Docker root directory. Is Docker running?" >&2
exit 1
fi
local available_kb available_mb
available_kb="$(df -Pk "${docker_root}" | awk 'NR == 2 {print $4}')"
available_mb=$((available_kb / 1024))
echo "Docker root: ${docker_root} (${available_mb} MB free)"
if (( available_mb < MIN_DOCKER_FREE_MB )); then
cat >&2 <<EOF
Not enough free space in Docker storage to build reliably.
Need at least ${MIN_DOCKER_FREE_MB} MB free; found ${available_mb} MB.
Run:
docker builder prune -f
docker image prune -f
docker container prune -f
Then check:
docker system df
df -h ${docker_root}
EOF
exit 1
fi
}
if [[ -n "${APP_IMAGE_ARCHIVE}" ]]; then
echo "Loading prebuilt app image from ${APP_IMAGE_ARCHIVE}"
docker load -i "${APP_IMAGE_ARCHIVE}"
@@ -39,6 +71,7 @@ elif [[ "${PULL_APP_IMAGE}" == "1" ]]; then
echo "Pulling app image ${APP_IMAGE_NAME}"
docker pull "${APP_IMAGE_NAME}"
elif [[ "${SKIP_BUILD}" != "1" ]]; then
check_docker_free_space
echo "Building app image ${APP_IMAGE_NAME}"
docker build -t "${APP_IMAGE_NAME}" "${ROOT_DIR}"
else

Binary file not shown.