Add docker-compose

This commit is contained in:
Sergey Zhemoytel 2025-01-13 22:59:42 +03:00
parent 53d52620fa
commit b9d5f0b884
3 changed files with 80 additions and 2 deletions

View file

@ -1,5 +1,5 @@
server:
address: ":8080"
address: ":8888"
repository:
path: "/var/www/html/urpm-repo"
log:

25
docker-compose.yml Normal file
View file

@ -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:

53
nginx.conf Normal file
View file

@ -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;
}
}
}