From 7d787da8e7634e34b57023f8530ba8492737146e Mon Sep 17 00:00:00 2001 From: "Go Johansson (neku)" Date: Sun, 1 Jan 2023 11:42:39 +0100 Subject: [PATCH] more --- Makefile | 7 +++---- docker/Dockerfile | 11 +++-------- docker/docker-entrypoint.sh | 6 +++--- docker/nginx/nginx.conf | 6 +++--- 4 files changed, 12 insertions(+), 18 deletions(-) diff --git a/Makefile b/Makefile index cf69cf8..fb0f536 100644 --- a/Makefile +++ b/Makefile @@ -19,9 +19,6 @@ TMPDIR = $(shell mktemp -d) DOCKER_IMAGE = "$(shell basename $(CURDIR) | tr [:upper:] [:lower:])" DOCKER_TAG = "$(DOCKER_TAG)" CONTAINER_NAME = "$(CONTAINER_NAME)" -# default modules -MODULES="php" - pageList = $(shell $(CURDIR)/$(NODEJQ) -r ".pages[]" $(CURDIR)/$(CONF)) noExt = $(shell echo $(i) | cut -d '.' -f1) @@ -91,11 +88,13 @@ npm_dependencies: $(NPM) install build-container-no-cache: - tar --exclude='./uguuForDocker.tar.gz' --exclude='./vendor' --exclude='./node_modules' --exclude='./build' --exclude='./dist' --exclude='./.git' -czf uguuForDocker.tar.gz . + rm uguuForDocker.tar.gz + tar --exclude='uguuForDocker.tar.gz' --exclude='vendor' --exclude='node_modules' --exclude='build' --exclude='dist' --exclude='.git' -czf uguuForDocker.tar.gz . mv uguuForDocker.tar.gz docker/ docker build -f docker/Dockerfile --build-arg VERSION=$(PKG_VERSION) --no-cache -t uguu:$(PKG_VERSION) . build-container: + rm uguuForDocker.tar.gz tar --exclude='uguuForDocker.tar.gz' --exclude='vendor' --exclude='node_modules' --exclude='build' --exclude='dist' --exclude='.git' -czf uguuForDocker.tar.gz . mv uguuForDocker.tar.gz docker/ docker build -f docker/Dockerfile --build-arg DOMAIN=$(SITEDOMAIN) --build-arg FILE_DOMAIN=$(FILESDOMAIN) --build-arg CONTACT_EMAIL=$(FILESDOMAIN) --build-arg MAX_SIZE=$(MAXSIZE) -t uguu:$(PKG_VERSION) . diff --git a/docker/Dockerfile b/docker/Dockerfile index 0b4a62b..880e658 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -2,7 +2,6 @@ FROM --platform=linux/amd64 debian:bullseye-slim # Install needed software RUN apt-get update - RUN apt-get install -y lsb-release ca-certificates apt-transport-https software-properties-common gnupg2 curl cron socat RUN echo "deb https://packages.sury.org/php/ $(lsb_release -sc) main" | tee /etc/apt/sources.list.d/sury-php.list RUN curl -fsSL https://packages.sury.org/php/apt.gpg| gpg --dearmor -o /etc/apt/trusted.gpg.d/sury-keyring.gpg @@ -17,7 +16,7 @@ RUN apt-get install -y build-essential nginx-full php8.1-fpm php8.1 sqlite3 php8 php8.1-mcrypt php8.1-mysql php8.1-xdebug php8.1-zip \ php8.1-common php8.1-readline php8.1-bcmath php8.1-common php8.1-xml - +# Set ENV values for configuration ARG DOMAIN ENV DOMAIN=$DOMAIN ARG FILE_DOMAIN @@ -78,14 +77,10 @@ EXPOSE 80 # Expose port 443 from the container EXPOSE 443 -#RUN service nginx restart -# Change user to www-data -#USER www-data - -#RUN cd /var/www/uguu && make && make install - +# Install acme.sh RUN curl -o acmeinstall.sh https://get.acme.sh RUN chmod a+x acmeinstall.sh RUN ./acmeinstall.sh + # Load entrypoint ENTRYPOINT [ "bash", "/var/www/docker-entrypoint.sh" ] \ No newline at end of file diff --git a/docker/docker-entrypoint.sh b/docker/docker-entrypoint.sh index 9f3a26f..cf7d19d 100644 --- a/docker/docker-entrypoint.sh +++ b/docker/docker-entrypoint.sh @@ -1,12 +1,12 @@ #!/bin/bash -cd /var/www/uguu +cd /var/www/uguu || exit npm install make make install service nginx stop rm /etc/nginx/sites-enabled/default /root/.acme.sh/acme.sh --set-default-ca --server letsencrypt -/root/.acme.sh/acme.sh --issue --standalone -d $DOMAIN -d $FILE_DOMAIN +/root/.acme.sh/acme.sh --issue --standalone -d "$DOMAIN" -d "$FILE_DOMAIN" service nginx start service php8.1-fpm start -tail -f /var/log/nginx/access.log \ No newline at end of file +tail -f /dev/null \ No newline at end of file diff --git a/docker/nginx/nginx.conf b/docker/nginx/nginx.conf index e962754..22ca851 100644 --- a/docker/nginx/nginx.conf +++ b/docker/nginx/nginx.conf @@ -4,8 +4,8 @@ pid /run/nginx.pid; include /etc/nginx/modules-enabled/*.conf; events { - worker_connections 768; - # multi_accept on; + worker_connections 1024; + multi_accept on; } http { @@ -37,7 +37,7 @@ http { # Logging Settings ## - access_log /var/log/nginx/access.log; + access_log off; error_log /var/log/nginx/error.log; ##