From b9d5f0b884c41a318cccb11cf247b609eb2af5dc Mon Sep 17 00:00:00 2001 From: Sergey Zhemoytel Date: Mon, 13 Jan 2025 22:59:42 +0300 Subject: [PATCH] Add docker-compose --- config.yaml | 4 ++-- docker-compose.yml | 25 ++++++++++++++++++++++ nginx.conf | 53 ++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 80 insertions(+), 2 deletions(-) create mode 100644 docker-compose.yml create mode 100644 nginx.conf diff --git a/config.yaml b/config.yaml index fb796d5..489cd74 100644 --- a/config.yaml +++ b/config.yaml @@ -1,6 +1,6 @@ server: - address: ":8080" + address: ":8888" repository: path: "/var/www/html/urpm-repo" log: - level: "info" \ No newline at end of file + level: "info" diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..eadca8f --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,25 @@ +version: '3' + +services: + urpm-repo: + image: urpm-repo:latest +# build: +# context: . +# dockerfile: Dockerfile + volumes: + - ./config.yaml:/config.yaml + - html-volume:/var/www/html/urpm-repo + ports: + - "8888:8888" + + nginx: + image: nginx:latest + volumes: + - html-volume:/var/www/html/urpm-repo + - ./nginx.conf:/etc/nginx/nginx.conf + ports: + - "8080:8080" + +volumes: + html-volume: + diff --git a/nginx.conf b/nginx.conf new file mode 100644 index 0000000..01830f0 --- /dev/null +++ b/nginx.conf @@ -0,0 +1,53 @@ +user nginx; +worker_processes 1; + +error_log /var/log/nginx/error.log warn; +pid /var/run/nginx.pid; + +events { + worker_connections 1024; +} + +http { + 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 /var/log/nginx/access.log main; + + sendfile on; + tcp_nopush on; + tcp_nodelay on; + keepalive_timeout 65; + types_hash_max_size 2048; + + include /etc/nginx/conf.d/*.conf; + + server { + listen 8080; + server_name localhost; + + location / { + root /var/www/html/urpm-repo; + autoindex on; + autoindex_exact_size off; + autoindex_localtime on; + } + + location ~ ^/(x86_64|i386|aarch64|riscv64|noarch|src)/ { + alias /var/www/html/urpm-repo/$1/; + autoindex on; + autoindex_exact_size off; + autoindex_localtime on; + } + + error_page 500 502 503 504 /50x.html; + location = /50x.html { + root /usr/share/nginx/html; + } + } +} +