fix the manager
This commit is contained in:
11
.dockerignore
Normal file
11
.dockerignore
Normal 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__
|
||||||
17
Dockerfile
17
Dockerfile
@@ -11,10 +11,12 @@ RUN mkdir -p /app /defaults \
|
|||||||
RUN ln -snf /usr/share/zoneinfo/Europe/Rome /etc/localtime && \
|
RUN ln -snf /usr/share/zoneinfo/Europe/Rome /etc/localtime && \
|
||||||
echo "Europe/Rome" > /etc/timezone
|
echo "Europe/Rome" > /etc/timezone
|
||||||
|
|
||||||
# The base image may include Docker's apt repository, but this image does not
|
# The base image may include third-party apt repositories, but this image only
|
||||||
# install Docker packages. Disable it so apt updates do not fail on stale keys.
|
# needs Debian packages. Disable inherited repos so stale keys cannot break apt.
|
||||||
RUN rm -f /etc/apt/sources.list.d/docker.list \
|
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 && \
|
RUN apt-get update && \
|
||||||
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
|
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 \
|
&& sed -i 's/# it_IT.UTF-8 UTF-8/it_IT.UTF-8 UTF-8/' /etc/locale.gen \
|
||||||
&& locale-gen it_IT.UTF-8 \
|
&& locale-gen it_IT.UTF-8 \
|
||||||
&& update-locale LANG=it_IT.UTF-8 LC_ALL=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.) ---
|
# --- 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 \
|
apt-get install -y --no-install-recommends \
|
||||||
fontconfig \
|
fontconfig \
|
||||||
cabextract \
|
cabextract \
|
||||||
xfonts-utils \
|
xfonts-utils; \
|
||||||
gnupg; \
|
|
||||||
\
|
\
|
||||||
sed -i 's/ main$/ main contrib/g' /etc/apt/sources.list; \
|
sed -i 's/ main$/ main contrib/g' /etc/apt/sources.list; \
|
||||||
apt-get update; \
|
apt-get update; \
|
||||||
@@ -56,7 +58,8 @@ RUN set -eux; \
|
|||||||
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ttf-mscorefonts-installer; \
|
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ttf-mscorefonts-installer; \
|
||||||
\
|
\
|
||||||
fc-cache -f -v; \
|
fc-cache -f -v; \
|
||||||
rm -rf /var/lib/apt/lists/*
|
apt-get clean; \
|
||||||
|
rm -rf /var/lib/apt/lists/* /var/cache/apt/archives/*.deb
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
33
install.sh
33
install.sh
@@ -12,6 +12,7 @@ SKIP_BUILD="${SKIP_BUILD:-0}"
|
|||||||
SKIP_MANAGER_BUILD="${SKIP_MANAGER_BUILD:-0}"
|
SKIP_MANAGER_BUILD="${SKIP_MANAGER_BUILD:-0}"
|
||||||
PULL_APP_IMAGE="${PULL_APP_IMAGE:-0}"
|
PULL_APP_IMAGE="${PULL_APP_IMAGE:-0}"
|
||||||
PULL_MANAGER_IMAGE="${PULL_MANAGER_IMAGE:-0}"
|
PULL_MANAGER_IMAGE="${PULL_MANAGER_IMAGE:-0}"
|
||||||
|
MIN_DOCKER_FREE_MB="${MIN_DOCKER_FREE_MB:-8192}"
|
||||||
|
|
||||||
echo "Project root: ${ROOT_DIR}"
|
echo "Project root: ${ROOT_DIR}"
|
||||||
echo "Manager dir: ${MANAGER_DIR}"
|
echo "Manager dir: ${MANAGER_DIR}"
|
||||||
@@ -32,6 +33,37 @@ ensure_image_exists() {
|
|||||||
fi
|
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
|
if [[ -n "${APP_IMAGE_ARCHIVE}" ]]; then
|
||||||
echo "Loading prebuilt app image from ${APP_IMAGE_ARCHIVE}"
|
echo "Loading prebuilt app image from ${APP_IMAGE_ARCHIVE}"
|
||||||
docker load -i "${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}"
|
echo "Pulling app image ${APP_IMAGE_NAME}"
|
||||||
docker pull "${APP_IMAGE_NAME}"
|
docker pull "${APP_IMAGE_NAME}"
|
||||||
elif [[ "${SKIP_BUILD}" != "1" ]]; then
|
elif [[ "${SKIP_BUILD}" != "1" ]]; then
|
||||||
|
check_docker_free_space
|
||||||
echo "Building app image ${APP_IMAGE_NAME}"
|
echo "Building app image ${APP_IMAGE_NAME}"
|
||||||
docker build -t "${APP_IMAGE_NAME}" "${ROOT_DIR}"
|
docker build -t "${APP_IMAGE_NAME}" "${ROOT_DIR}"
|
||||||
else
|
else
|
||||||
|
|||||||
Binary file not shown.
Reference in New Issue
Block a user