Merge branch 'do'

This commit is contained in:
Giles Bradshaw 2020-04-18 11:42:36 +01:00
commit e2b5a423be
11 changed files with 128 additions and 2 deletions

View File

@ -69,6 +69,20 @@ steps:
- cd letsencrypt-nginx
- docker build . -t $${LOCAL_DOCKER_REGISTRY}letsencrypt-nginx
- docker push $${LOCAL_DOCKER_REGISTRY}letsencrypt-nginx
- name: build-nginx-home
when:
branch:
- home-deploy
image: docker:dind
volumes:
- name: dockersock
path: /var/run
environment:
LOCAL_DOCKER_REGISTRY:
from_secret: local-docker-registry
commands:
- cd letsencrypt-nginx
- sh build.home.sh $${LOCAL_DOCKER_REGISTRY}
- name: build-letsencrypt-blog
when:
branch:
@ -224,6 +238,7 @@ steps:
- export REMOTE_DOMAIN=$REMOTE_DOMAIN
- export BLOG_DOMAIN=$BLOG_DOMAIN
- docker pull $${LOCAL_DOCKER_REGISTRY}letsencrypt-git
- docker pull $${LOCAL_DOCKER_REGISTRY}nginx-home1
- docker pull $${LOCAL_DOCKER_REGISTRY}letsencrypt-chat
- docker pull $${LOCAL_DOCKER_REGISTRY}letsencrypt-remote
- docker pull $${LOCAL_DOCKER_REGISTRY}letsencrypt-blog

View File

@ -334,6 +334,19 @@ services:
volumes:
- mongo-chat:/data/db
command: mongod --smallfiles --replSet rs0 --oplogSize 128
nginx-home:
deploy:
placement:
constraints: [node.labels.com.sigyl.git-stack == yes]
replicas: 1
restart_policy:
condition: any
image: ${LOCAL_DOCKER_REGISTRY}nginx-home1
environment:
- SERVER_NAME=${BLOG_DOMAIN}
ports:
- 80:80
volumes:
gitea-app:
gitea-db:

View File

@ -1,3 +1,4 @@
ARG image
FROM $image
COPY website /www/data
COPY ./conf/do.conf /etc/nginx/user.conf.d/server._conf

View File

@ -0,0 +1,7 @@
ARG image
FROM $image
COPY ./conf/home.conf /etc/nginx/user.conf.d/server._conf
COPY nginx.conf /etc/nginx
COPY website /www/data
COPY home.sh /
CMD sh /home.sh

View File

@ -0,0 +1,3 @@
set -e
docker build . -f Dockerfile.home --build-arg image=nginx:latest -t $1nginx-home1
docker push $1nginx-home1

View File

@ -1,3 +1,3 @@
set -e
docker build . -f Dockerfile.$1 --build-arg image=sigyl.com:5001/letsencrypt-nginx -t sigyl.com:5001/letsencrypt-$1
docker push sigyl.com:5001/letsencrypt-$1
docker build . -f Dockerfile.$1 --build-arg image=$2letsencrypt-nginx -t $2letsencrypt-$1
docker push $2letsencrypt-$1

View File

@ -115,6 +115,11 @@
chunked_transfer_encoding on;
server_name ${SERVER_NAME};
root /www/data;
location / {
}
location ${LOCATION} {
proxy_pass ${PROXY_PASS};

View File

@ -0,0 +1,20 @@
server {
# resolver 127.0.0.11 valid=30s; ## internal docker dns
#listen [::]:3011 default ipv6only=on; ## listen for ipv6
listen 80;
client_header_timeout 120s;
client_body_timeout 120s;
client_max_body_size 200m;
# save logs here
root /www/data;
location / {
}
}

View File

@ -0,0 +1,4 @@
export DOLLAR='$'
envsubst < /etc/nginx/user.conf.d/server._conf > /etc/nginx/user.conf.d/server.conf
cat /etc/nginx/user.conf.d/server.conf
nginx -g "daemon off;"

View File

@ -0,0 +1,31 @@
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;
keepalive_timeout 65;
#gzip on;
include /etc/nginx/user.conf.d/*.conf;
}

View File

@ -0,0 +1,27 @@
<h1>SiGyl Ltd</h1>
<ul>
<li>
<a href='https://sigyl.com/git'>repos</a>
</li>
<li>
<a href='https://sigyl.com/chat'>chat</a>
</li>
<li>
<a href='https://sigyl.com:5000'>drone</a>
</li>
</ul>
<h2>home</h2>
<ul>
<li>
<a href='https://git.sigyl.com'>repos</a>
</li>
<li>
<a href='https://drone.sigyl.com'>drone</a>
</li>
<li>
<a href='https://remote.sigyl.com'>remote</a>
</li>
</ul>