diff --git a/.env.scripts b/.env.scripts index e4ee4ca..7740cc6 100644 --- a/.env.scripts +++ b/.env.scripts @@ -1,10 +1,10 @@ # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -##@Version : 202409171130-git +##@Version : 202409171432-git # @@Author : CasjaysDev # @@Contact : CasjaysDev # @@License : MIT # @@Copyright : Copyright 2024 CasjaysDev -# @@Created : Tue Sep 17 11:30:22 AM EDT 2024 +# @@Created : Tue Sep 17 02:32:16 PM EDT 2024 # @@File : .env.scripts # @@Description : Variables for gen-dockerfile and buildx scripts # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -17,7 +17,7 @@ DOCKER_ENTYPOINT_HEALTH_ENDPOINTS="$DOCKER_ENTYPOINT_HEALTH_ENDPOINTS" # Dockerfile info ENV_DOCKERFILE="Dockerfile" ENV_IMAGE_NAME="coolify" -ENV_USE_TEMPLATE="alpine" +ENV_USE_TEMPLATE="debian" # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # Maintainer info ENV_ORG_NAME="casjaysdevdocker" @@ -56,5 +56,5 @@ DEFAULT_DATA_DIR="/usr/local/share/template-files/data" DEFAULT_CONF_DIR="/usr/local/share/template-files/config" DEFAULT_TEMPLATE_DIR="/usr/local/share/template-files/defaults" # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -ENV_PACKAGES="openrc curl wget git jq docker docker-cli-compose openssh-server openssh " +ENV_PACKAGES="systemd systemd-sysv cron curl wget git jq openssh-server " # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Dockerfile b/Dockerfile index 8b047bc..b45884c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,8 +1,8 @@ # syntax=docker/dockerfile:1 -# Docker image for coolify using the alpine template +# Docker image for coolify using the debian template ARG IMAGE_NAME="coolify" ARG PHP_SERVER="coolify" -ARG BUILD_DATE="202409171130" +ARG BUILD_DATE="202409171432" ARG LANGUAGE="en_US.UTF-8" ARG TIMEZONE="America/New_York" ARG WWW_ROOT_DIR="/usr/share/httpd/default" @@ -10,6 +10,7 @@ ARG DEFAULT_FILE_DIR="/usr/local/share/template-files" ARG DEFAULT_DATA_DIR="/usr/local/share/template-files/data" ARG DEFAULT_CONF_DIR="/usr/local/share/template-files/config" ARG DEFAULT_TEMPLATE_DIR="/usr/local/share/template-files/defaults" +ARG DEBIAN_FRONTEND=noninteractive ARG USER="root" ARG SHELL_OPTS="set -e -o pipefail" @@ -52,16 +53,19 @@ ARG NODE_MANAGER ARG PHP_VERSION ARG PHP_SERVER ARG SHELL_OPTS +ARG DEBIAN_FRONTEND -ARG PACK_LIST="openrc curl wget git jq docker docker-cli-compose openssh-server openssh " +ARG PACK_LIST="systemd systemd-sysv cron curl wget git jq openssh-server " ENV ENV=~/.profile ENV SHELL="/bin/sh" ENV TZ="${TIMEZONE}" ENV TIMEZONE="${TZ}" ENV LANG="${LANGUAGE}" +ENV LC_ALL="${LANGUAGE}" ENV TERM="xterm-256color" ENV HOSTNAME="casjaysdevdocker-coolify" +ENV DEBIAN_FRONTEND="${DEBIAN_FRONTEND}" USER ${USER} WORKDIR /root @@ -239,6 +243,7 @@ ENV NODE_MANAGER="${NODE_MANAGER}" ENV PHP_VERSION="${PHP_VERSION}" ENV DISTRO_VERSION="${IMAGE_VERSION}" ENV WWW_ROOT_DIR="${WWW_ROOT_DIR}" +ENV container=docker COPY --from=build /. / @@ -246,6 +251,7 @@ VOLUME [ "/config","/data" ] EXPOSE ${SERVICE_PORT} ${ENV_PORTS} +STOPSIGNAL SIGRTMIN+3 + CMD [ "/sbin/init" ] -#ENTRYPOINT [ "tini","--","/usr/local/bin/entrypoint.sh" ] -HEALTHCHECK --start-period=10m --interval=5m --timeout=15s CMD [ "wget -qO- http://localhost:80/ping || exit 1" ] +HEALTHCHECK --start-period=10m --interval=5m --timeout=15s CMD [ "curl", "-qLSsf", "http://localhost:8000" ] diff --git a/rootfs/root/docker/setup/02-packages.sh b/rootfs/root/docker/setup/02-packages.sh index a0d4db9..3fdb1c3 100755 --- a/rootfs/root/docker/setup/02-packages.sh +++ b/rootfs/root/docker/setup/02-packages.sh @@ -27,25 +27,13 @@ exitCode=0 # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # Predifined actions -sed -i 's/^\(tty\d\:\:\)/#\1/g' /etc/inittab && - sed -i \ - -e 's/#rc_sys=".*"/rc_sys="docker"/g' \ - -e 's/#rc_env_allow=".*"/rc_env_allow="\*"/g' \ - -e 's/#rc_crashed_stop=.*/rc_crashed_stop=NO/g' \ - -e 's/#rc_crashed_start=.*/rc_crashed_start=YES/g' \ - -e 's/#rc_provide=".*"/rc_provide="loopback net"/g' \ - /etc/rc.conf && - rm -f /etc/init.d/hwdrivers \ - /etc/init.d/hwclock \ - /etc/init.d/hwdrivers \ - /etc/init.d/modules \ - /etc/init.d/modules-load \ - /etc/init.d/modloop && - sed -i 's/cgroup_add_service /# cgroup_add_service /g' /lib/rc/sh/openrc-run.sh && - sed -i 's/VSERVER/DOCKER/Ig' /lib/rc/sh/init.sh -for service in cgroups sshd docker; do - rc-update add $service -done +apt-get update +apt-get install ca-certificates curl +install -m 0755 -d /etc/apt/keyrings +curl -q -LSsf "https://download.docker.com/linux/debian/gpg" -o "/etc/apt/keyrings/docker.asc" +chmod a+r /etc/apt/keyrings/docker.asc +printf '%s %s\n' "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/debian" "$(. /etc/os-release && echo "$VERSION_CODENAME") stable" | tee /etc/apt/sources.list.d/docker.list >/dev/null +apt-get update # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # Main script diff --git a/rootfs/root/docker/setup/07-cleanup.sh b/rootfs/root/docker/setup/07-cleanup.sh index 278dcd0..7915e72 100755 --- a/rootfs/root/docker/setup/07-cleanup.sh +++ b/rootfs/root/docker/setup/07-cleanup.sh @@ -28,8 +28,8 @@ exitCode=0 # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # Predifined actions [ -d "/tmp" ] && rm -Rf "/tmp"/* -[ -d "/run/openrc" ] || mkdir -p "/run/openrc" -[ -f "/run/openrc/softlevel" ] || touch "/run/openrc/softlevel" +rm -f /etc/machine-id /var/lib/dbus/machine-id +systemctl mask -- dev-hugepages.mount sys-fs-fuse-connections.mount # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # Main script