diff --git a/.gitea/workflows/check-license.yml b/.gitea/workflows/check-license.yml new file mode 100644 index 0000000..cc28722 --- /dev/null +++ b/.gitea/workflows/check-license.yml @@ -0,0 +1,29 @@ +# Copyright Avroid, Ltd. 2023-2024 +# +# You can not use the contents of the file in any way without +# AVROID, Ltd. written permission. +# +# To obtain such a permit, you should contact AVROID, Ltd. +# at https://avroid.ru + +--- +name: Check license +run-name: ${{ gitea.actor }} is start check sources +on: [pull_request] + +jobs: + scan-secrets: + name: Check license + runs-on: docker + container: + image: harbor.avroid.tech/devops/node:20-alpine3.19-0 + steps: + - run: echo "Start job on ${{ runner.name }} with os ${{ runner.os }}" + - run: echo "Work with branch ${{ gitea.ref }} repository ${{ gitea.repository }}" + - name: Check out repository code + uses: https://git-mirrors.avroid.tech/Mirrors-actions/checkout.git@v4 + with: + fetch-depth: 0 # for work tj-actions/changed-files + persist-credentials: false # for work tj-actions/changed-files + - name: Check license + uses: https://gitea:${{ secrets.CI_TOKEN }}@git.avroid.tech/Actions/addlicense-docker-action.git@v1 diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..723c6b1 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,7 @@ +# Changelog + +## [05.02.2025] - node:1.27.3-alpine3.20 + +ADD: + +* nginx-1.27.3-alpine3.20 diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..2c4fc00 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,26 @@ +# Copyright Avroid, Ltd. 2023-2025 +# +# You can not use the contents of the file in any way without +# AVROID, Ltd. written permission. +# +# To obtain such a permit, you should contact AVROID, Ltd. +# at https://avroid.ru + +ARG DOCKER_REGISTRY=harbor.avroid.tech/docker-hub-proxy/library + +ARG IMAGE_TAG="" + +FROM ${DOCKER_REGISTRY}/nginx:${IMAGE_TAG} + +LABEL description="Nginx rootless" + +LABEL app.nginx.version="${IMAGE_TAG}" + +COPY rootfs / + +RUN ln -s /dev/stderr /tmp/error.log \ + && ln -s /dev/stdout /tmp/access.log + +EXPOSE 8080 + +USER nginx diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..da4afba --- /dev/null +++ b/Makefile @@ -0,0 +1,33 @@ +.PHONY: all build push clean + +IMAGE_NAME = nginx +IMAGE_GROUP = devops +IMAGE_TAG = 1.27.3-alpine3.20 +REVISION = +DOCKER_REGISTRY = harbor.avroid.tech + +all: + @echo 'DEFAULT:' + @echo ' make build' + @echo ' make push' + @echo ' make getTag' + @echo ' make clean' + +build: + DOCKER_BUILDKIT=1 docker build \ + -f Dockerfile \ + --platform linux/amd64 \ + --build-arg IMAGE_TAG=$(IMAGE_TAG) \ + -t $(DOCKER_REGISTRY)/$(IMAGE_GROUP)/$(IMAGE_NAME):$(IMAGE_TAG)$(REVISION) . + +push: +ifeq ($(CI), false) + docker login https://$(DOCKER_REGISTRY) +endif + docker push $(DOCKER_REGISTRY)/$(IMAGE_GROUP)/$(IMAGE_NAME):$(IMAGE_TAG)$(REVISION) + +getTag: + @echo $(IMAGE_TAG) + +clean: + docker rmi $(DOCKER_REGISTRY)/$(IMAGE_GROUP)/$(IMAGE_NAME):$(IMAGE_TAG)$(REVISION) diff --git a/README.md b/README.md index f17ba80..31258c6 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,29 @@ # nginx +## Данный репозиторий используется как основа для остальных репозиториев + +Для сборки образа выполните + +```bash +make build +``` + +Для загрузки образа в harbor выполните + +```bash +make push +``` + +Для вывода тега докер образа выполните + +```bash +make getTag +``` + +Для удаления образа из системы выполните + +```bash +make clean +``` + +За версию докер образа отвечает переменная IMAGE_TAG в [Makefile](./Makefile#L5) diff --git a/rootfs/etc/nginx/conf.d/default.conf b/rootfs/etc/nginx/conf.d/default.conf new file mode 100644 index 0000000..91c1a35 --- /dev/null +++ b/rootfs/etc/nginx/conf.d/default.conf @@ -0,0 +1,9 @@ +server { + listen 8080; + server_name localhost; + + location / { + root /srv; + index index.html index.htm; + } +} diff --git a/rootfs/etc/nginx/nginx.conf b/rootfs/etc/nginx/nginx.conf new file mode 100644 index 0000000..2981491 --- /dev/null +++ b/rootfs/etc/nginx/nginx.conf @@ -0,0 +1,35 @@ +user nginx; +worker_processes auto; + +error_log /tmp/error.log notice; +pid /tmp/nginx.pid; + +events { + worker_connections 1024; +} + +http { + client_body_temp_path /tmp/client_temp; + proxy_temp_path /tmp/proxy_temp_path; + fastcgi_temp_path /tmp/fastcgi_temp; + uwsgi_temp_path /tmp/uwsgi_temp; + scgi_temp_path /tmp/scgi_temp; + + include /etc/nginx/mime.types; + default_type application/octet-stream; + + log_format main '$remote_addr - $remote_user [$time_local] "$request" ' + '$status $body_bytes_sent "$http_referer" ' + '"$http_user_agent" "$http_x_forwarded_for"'; + + access_log /tmp/access.log main; + + sendfile on; + #tcp_nopush on; + + keepalive_timeout 65; + + #gzip on; + + include /etc/nginx/conf.d/*.conf; +}