Initial commit

This commit is contained in:
Colin Diem
2021-04-04 03:45:08 +00:00
commit 990da5d091
8 changed files with 191 additions and 0 deletions

View File

@@ -0,0 +1,13 @@
version: '3'
services:
bitwarden:
container_name: bitwarden
image: bitwardenrs/server
restart: always
volumes:
- ./data:/data
expose:
- '80'
environment:
WEBSOCKET_ENABLED: 'true'
SIGNUPS_ALLOWED: 'true'

44
gitea/docker-compose.yml Normal file
View File

@@ -0,0 +1,44 @@
version: "3"
networks:
gitea:
external:
name: gitea
services:
server:
image: gitea/gitea:1.13.6
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
expose:
- "80"
- "3000"
- "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

View File

@@ -0,0 +1,13 @@
FROM nginx:1.19.9
# default conf for proxy services
COPY ./default.conf /etc/nginx/conf.d/default.conf
# NOT FOUND response
COPY ./backend-not-found.html /var/www/html/backend-not-found.html
# Proxy and SSL configurations
COPY ./includes/ /etc/nginx/includes/
# Proxy SSL certificates
COPY ./ssl/ /etc/ssl/certs/nginx/

View File

@@ -0,0 +1,6 @@
<html>
<head><title>Proxy Backend Not Found</title></head>
<body >
<h2>Proxy Backend Not Found</h2>
</body>
</html>

View File

@@ -0,0 +1,78 @@
# blog config
server {
listen 80;
listen 443 ssl http2;
server_name colindiem.com;
# Path for SSL config/key/certificate
ssl_certificate /etc/ssl/certs/nginx/blog.crt;
ssl_certificate_key /etc/ssl/certs/nginx/blog.key;
include /etc/nginx/includes/ssl.conf;
location / {
include /etc/nginx/includes/proxy.conf;
proxy_pass http://blog;
}
access_log /var/log/nginx/access.log combined;
error_log /var/log/nginx/error.log error;
}
# Bitwarden cofig
server {
listen 80;
listen 443 ssl http2;
server_name bitwarden.colindiem.com;
ssl_certificate /etc/ssl/certs/nginx/bitwarden.crt;
ssl_certificate_key /etc/ssl/certs/nginx/bitwarden.key;
include /etc/nginx/includes/ssl.conf;
location / {
include /etc/nginx/includes/proxy.conf;
proxy_pass http://bitwarden;
}
access_log /var/log/nginx/bitwarden-access.log combined;
error_log /var/log/nginx/bitwarden-error.log error;
}
# Gitea config
server {
listen 80;
listen 3000;
listen 22;
server_name git.colindiem.com;
client_max_body_size 0;
location / {
include /etc/nginx/includes/proxy.conf;
proxy_pass http://gitea:3000;
}
access_log /var/log/nginx/gitea-access.log combined;
error_log /var/log/nginx/gitea-error.log error;
}
# Default
server {
listen 80 default_server;
server_name _;
root /var/www/html;
charset UTF-8;
error_page 404 /backend-not-found.html;
location = /backend-not-found.html {
allow all;
}
location / {
return 404;
}
access_log off;
log_not_found off;
error_log /var/log/nginx/error.log error;
}

View File

@@ -0,0 +1,23 @@
version: '2'
services:
proxy:
container_name: rev-proxy
build: ./
networks:
- blog
- bitwarden
- gitea
ports:
- 80:80
- 443:443
networks:
blog:
external:
name: blog_default
bitwarden:
external:
name: bitwarden_default
gitea:
external:
name: gitea

View File

@@ -0,0 +1,8 @@
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_buffering off;
proxy_request_buffering off;
proxy_http_version 1.1;
proxy_intercept_errors on;

View File

@@ -0,0 +1,6 @@
ssl_session_timeout 1d;
ssl_session_cache shared:SSL:50m;
ssl_session_tickets off;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_prefer_server_ciphers on;