From fefca2b6e9cac0b8339e5cc577d3377f263a3032 Mon Sep 17 00:00:00 2001 From: "Pavel@Vostro5468" Date: Wed, 5 Jan 2022 18:36:36 +0300 Subject: [PATCH] Added fox-start.d and fixed rootfs --- .dockerignore | 2 ++ Dockerfile | 13 ++++++------- docker-entrypoint.sh | 4 ---- last_version | 2 +- rootfs/docker-entrypoint.sh | 7 +++++++ .../etc/apache2/sites-available/000-default.conf | 0 rootfs/etc/fox-start.d/00_cron-fix.sh | 7 +++++++ localtime => rootfs/etc/localtime | Bin timezone => rootfs/etc/timezone | 0 rootfs/var/www/html/index.php | 3 +++ 10 files changed, 26 insertions(+), 12 deletions(-) create mode 100644 .dockerignore delete mode 100755 docker-entrypoint.sh create mode 100755 rootfs/docker-entrypoint.sh rename 000-default.conf => rootfs/etc/apache2/sites-available/000-default.conf (100%) create mode 100755 rootfs/etc/fox-start.d/00_cron-fix.sh rename localtime => rootfs/etc/localtime (100%) rename timezone => rootfs/etc/timezone (100%) create mode 100644 rootfs/var/www/html/index.php diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..319f0b8 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,2 @@ +/images +/.git \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index 4e64d83..f037866 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,10 +1,10 @@ -FROM ubuntu:18.04 +FROM ubuntu:20.04 ENV php_version=7.4 -COPY ["timezone", "localtime", "/etc/"] +COPY ["/rootfs/etc/timezone", "/rootfs/etc/localtime", "/etc/"] -RUN apt update -y \ +RUN apt-get update -y \ && apt-get install gnupg gnupg1 gnupg2 software-properties-common -y \ && apt-add-repository ppa:ondrej/php \ && apt-get update -y \ @@ -30,10 +30,9 @@ RUN apt update -y \ && rm -rf /var/lib/apt/lists/* \ && rm -rf /var/www/html/* \ && a2enmod rewrite - -COPY docker-entrypoint.sh / -COPY 000-default.conf /etc/apache2/sites-available -WORKDIR /var/www/hmtl + +COPY rootfs / +WORKDIR /var/www/html EXPOSE 80 CMD ["/docker-entrypoint.sh"] diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh deleted file mode 100755 index 9364c3a..0000000 --- a/docker-entrypoint.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/sh - -service cron start -bash -c "source /etc/apache2/envvars && exec /usr/sbin/apache2 -DFOREGROUND" \ No newline at end of file diff --git a/last_version b/last_version index b047711..73d9381 100644 --- a/last_version +++ b/last_version @@ -1 +1 @@ -100050 +100056 diff --git a/rootfs/docker-entrypoint.sh b/rootfs/docker-entrypoint.sh new file mode 100755 index 0000000..e34edd8 --- /dev/null +++ b/rootfs/docker-entrypoint.sh @@ -0,0 +1,7 @@ +#!/bin/sh + +find /etc/fox-start.d -maxdepth 1 -type f -exec {} \; +echo "Starting cron:" +service cron start +echo "Starting apache:" +bash -c "source /etc/apache2/envvars && exec /usr/sbin/apache2 -DFOREGROUND" \ No newline at end of file diff --git a/000-default.conf b/rootfs/etc/apache2/sites-available/000-default.conf similarity index 100% rename from 000-default.conf rename to rootfs/etc/apache2/sites-available/000-default.conf diff --git a/rootfs/etc/fox-start.d/00_cron-fix.sh b/rootfs/etc/fox-start.d/00_cron-fix.sh new file mode 100755 index 0000000..03c0eb0 --- /dev/null +++ b/rootfs/etc/fox-start.d/00_cron-fix.sh @@ -0,0 +1,7 @@ +#!/bin/sh + +echo -n "Touching cron..." +touch /etc/crontab +find /etc/cron.d -maxdepth 1 -type f -exec bash -c "touch '{}'" \; +echo "OK" + diff --git a/localtime b/rootfs/etc/localtime similarity index 100% rename from localtime rename to rootfs/etc/localtime diff --git a/timezone b/rootfs/etc/timezone similarity index 100% rename from timezone rename to rootfs/etc/timezone diff --git a/rootfs/var/www/html/index.php b/rootfs/var/www/html/index.php new file mode 100644 index 0000000..15c5adc --- /dev/null +++ b/rootfs/var/www/html/index.php @@ -0,0 +1,3 @@ + \ No newline at end of file