From 1d2f2258a137067d523e2f35aec8f2272b918b5f Mon Sep 17 00:00:00 2001 From: Sergey Kalinin Date: Fri, 9 Apr 2021 13:27:46 +0300 Subject: [PATCH] =?UTF-8?q?=D0=94=D0=9E=D0=B1=D0=B0=D0=B2=D0=BB=D0=B5?= =?UTF-8?q?=D0=BD=20=D0=BA=D0=BE=D0=BD=D1=82=D0=B5=D0=B9=D0=BD=D0=B5=D1=80?= =?UTF-8?q?=20=D1=81=D0=BE=20=D1=81=D1=82=D0=B0=D1=82=D0=B8=D0=BA=D0=BE?= =?UTF-8?q?=D0=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- git.nuk-svk.ru/docker-compose.yml | 82 ------------------------ git.nuk-svk.ru/gitea/.env | 3 + git.nuk-svk.ru/gitea/docker-compose.yml | 61 ++++++++++++++++++ git.nuk-svk.ru/proxy/Dockerfile | 3 + git.nuk-svk.ru/proxy/docker-compose.yml | 39 +++++++++++ git.nuk-svk.ru/proxy/uploadsize.conf | 2 + git.nuk-svk.ru/static/docker-compose.yml | 24 +++++++ 7 files changed, 132 insertions(+), 82 deletions(-) delete mode 100644 git.nuk-svk.ru/docker-compose.yml create mode 100644 git.nuk-svk.ru/gitea/.env create mode 100644 git.nuk-svk.ru/gitea/docker-compose.yml create mode 100644 git.nuk-svk.ru/proxy/Dockerfile create mode 100644 git.nuk-svk.ru/proxy/docker-compose.yml create mode 100644 git.nuk-svk.ru/proxy/uploadsize.conf create mode 100644 git.nuk-svk.ru/static/docker-compose.yml diff --git a/git.nuk-svk.ru/docker-compose.yml b/git.nuk-svk.ru/docker-compose.yml deleted file mode 100644 index 0a75a06..0000000 --- a/git.nuk-svk.ru/docker-compose.yml +++ /dev/null @@ -1,82 +0,0 @@ -version: "3" - -networks: - gitea: - external: false - -services: - gitea: - image: gitea/gitea:1.13.1 - container_name: gitea - environment: - - USER_UID=1000 - - USER_GID=1000 - - DB_TYPE=postgres - - DB_HOST=db:5432 - - DB_NAME=gitea - - DB_USER=gitea - - DB_PASSWD=gitea - restart: always - networks: - - gitea - volumes: - - ./gitea:/data - - /etc/timezone:/etc/timezone:ro - - /etc/localtime:/etc/localtime:ro - ports: - - "3000:3000" - - "222:22" - depends_on: - - db - - db: - image: postgres:9.6 - restart: always - environment: - - POSTGRES_USER=gitea - - POSTGRES_PASSWORD=gitea - - POSTGRES_DB=gitea - networks: - - gitea - volumes: - - postgres:/var/lib/postgresql/data - - nginx-proxy: - image: jwilder/nginx-proxy - container_name: nginx-proxy - ports: - - "80:80" - - "443:443" - volumes: - - conf:/etc/nginx/conf.d - - vhost:/etc/nginx/vhost.d - - html:/usr/share/nginx/html - - dhparam:/etc/nginx/dhparam - - certs:/etc/nginx/certs:ro - - /var/run/docker.sock:/tmp/docker.sock:ro -# network_mode: bridge - networks: - - gitea - - letsencrypt: - image: jrcs/letsencrypt-nginx-proxy-companion - container_name: nginx-proxy-le - volumes_from: - - nginx-proxy - volumes: - - certs:/etc/nginx/certs:rw - - acme:/etc/acme.sh - - /var/run/docker.sock:/var/run/docker.sock:ro - networks: - - gitea -# network_mode: bridge - -volumes: - postgres: - gitea: - conf: - vhost: - html: - dhparam: - certs: - acme: \ No newline at end of file diff --git a/git.nuk-svk.ru/gitea/.env b/git.nuk-svk.ru/gitea/.env new file mode 100644 index 0000000..77ef515 --- /dev/null +++ b/git.nuk-svk.ru/gitea/.env @@ -0,0 +1,3 @@ +URL=git.nuk-svk.ru +NETWORK=proxy_proxy-tier +DB_PASSWD=5BpfiZRZKBHHgZ5B diff --git a/git.nuk-svk.ru/gitea/docker-compose.yml b/git.nuk-svk.ru/gitea/docker-compose.yml new file mode 100644 index 0000000..9eb6930 --- /dev/null +++ b/git.nuk-svk.ru/gitea/docker-compose.yml @@ -0,0 +1,61 @@ +version: "2" + +volumes: + gitea-db: + driver: local + +services: + server: + image: gitea/gitea:1 + env_file: + - .env + environment: + - USER_UID=1000 + - USER_GID=1000 + - DB_TYPE=postgres + - DB_HOST=db:5432 + - DB_NAME=gitea + - DB_USER=gitea + - DB_PASSWD=${DB_PASSWD} + - DOMAIN=${URL} + - SSH_DOMAIN=${URL} + - DISABLE_REGISTRATION=true + - VIRTUAL_HOST=${URL} + - VIRTUAL_PORT=3000 + - LETSENCRYPT_HOST=${URL} + - LETSENCRYPT_EMAIL=svk@nuk-svk.ru + - ROOT_URL=https://${URL} + - REDIRECT_OTHER_PORT=true + - PORT_TO_REDIRECT=463 + - ENABLE_PUSH_CREATE_USER=true + - ENABLE_PUSH_CREATE_ORG=true + restart: always + volumes: + - gitea:/data + - /etc/timezone:/etc/timezone:ro + - /etc/localtime:/etc/localtime:ro + ports: + - "2222:22" + depends_on: + - db + expose: + - 3000 + + db: + image: postgres:9.6 + restart: always + env_file: + - .env + environment: + - POSTGRES_USER=gitea + - POSTGRES_PASSWORD=${DB_PASSWD} + - POSTGRES_DB=gitea + volumes: + - gitea-db:/var/lib/postgresql/data +networks: + default: + external: + name: ${NETWORK} +volumes: + gitea: + gitea-db: diff --git a/git.nuk-svk.ru/proxy/Dockerfile b/git.nuk-svk.ru/proxy/Dockerfile new file mode 100644 index 0000000..242c84e --- /dev/null +++ b/git.nuk-svk.ru/proxy/Dockerfile @@ -0,0 +1,3 @@ +FROM jwilder/nginx-proxy:alpine + +COPY uploadsize.conf /etc/nginx/conf.d/uploadsize.conf diff --git a/git.nuk-svk.ru/proxy/docker-compose.yml b/git.nuk-svk.ru/proxy/docker-compose.yml new file mode 100644 index 0000000..6bf1041 --- /dev/null +++ b/git.nuk-svk.ru/proxy/docker-compose.yml @@ -0,0 +1,39 @@ +version: '3' + +services: + proxy: + build: ./ + restart: always + ports: + - 80:80 + - 443:443 + labels: + com.github.jrcs.letsencrypt_nginx_proxy_companion.nginx_proxy: "true" + volumes: + - certs:/etc/nginx/certs:ro + - vhost.d:/etc/nginx/vhost.d + - html:/usr/share/nginx/html + - /var/run/docker.sock:/tmp/docker.sock:ro + networks: + - proxy-tier + + letsencrypt-companion: + image: jrcs/letsencrypt-nginx-proxy-companion + restart: always + volumes: + - certs:/etc/nginx/certs + - vhost.d:/etc/nginx/vhost.d + - html:/usr/share/nginx/html + - /var/run/docker.sock:/var/run/docker.sock:ro + networks: + - proxy-tier + depends_on: + - proxy + +volumes: + certs: + vhost.d: + html: + +networks: + proxy-tier: diff --git a/git.nuk-svk.ru/proxy/uploadsize.conf b/git.nuk-svk.ru/proxy/uploadsize.conf new file mode 100644 index 0000000..7e3906e --- /dev/null +++ b/git.nuk-svk.ru/proxy/uploadsize.conf @@ -0,0 +1,2 @@ +client_max_body_size 10G; +proxy_request_buffering off; diff --git a/git.nuk-svk.ru/static/docker-compose.yml b/git.nuk-svk.ru/static/docker-compose.yml new file mode 100644 index 0000000..871a78a --- /dev/null +++ b/git.nuk-svk.ru/static/docker-compose.yml @@ -0,0 +1,24 @@ +version: '2' + +services: + static: + image: nginx + container_name: nginx-static + restart: always + environment: + - VIRTUAL_HOST=nuk-svk.ru + - LETSENCRYPT_HOST=nuk-svk.ru + #- VIRTUAL_PORT=443 + #- VIRTUAL_PROTO=https + volumes: + - vhost.d:/etc/nginx/vhost.d + - html:/usr/share/nginx/html + +volumes: + vhost.d: + html: + +networks: + default: + external: + name: proxy_proxy-tier