add drone, split networks in compose

This commit is contained in:
simon 2022-05-11 23:17:11 +07:00
parent d93db966ff
commit 50d17c6c3c
No known key found for this signature in database
GPG Key ID: 2C15AA5E89985DD4
3 changed files with 66 additions and 1 deletions

1
.gitignore vendored
View File

@ -6,6 +6,7 @@ config.json
postgres.env
tubearchivist.env
umami.env
drone.env
# example hooks
docker-hook.json

View File

@ -12,6 +12,11 @@ services:
- ./volume/nginx-proxy/vhost:/etc/nginx/vhost.d
- ./volume/nginx-proxy/html:/usr/share/nginx/html
- /var/run/docker.sock:/tmp/docker.sock:ro
networks:
- front
- tubearchivist_network
- umami_network
- drone_network
nginx-proxy-acme:
image: nginxproxy/acme-companion
container_name: nginx-proxy-acme
@ -23,6 +28,9 @@ services:
- /var/run/docker.sock:/var/run/docker.sock:ro
environment:
- NGINX_PROXY_CONTAINER=nginx-proxy
networks:
- front
# main flask site
nginx:
build: ./tubearchivist/nginx
container_name: backend_nginx
@ -34,7 +42,8 @@ services:
environment:
- VIRTUAL_HOST=tubearchivist.com,www.tubearchivist.com
- LETSENCRYPT_HOST=tubearchivist.com,www.tubearchivist.com
# main flask site
networks:
- tubearchivist_network
tubearchivist:
container_name: tubearchivist
build: ./tubearchivist/web
@ -43,6 +52,8 @@ services:
- ./env/tubearchivist.env
expose:
- "8080"
networks:
- tubearchivist_network
# backend postgres
postgres:
image: postgres:14
@ -54,6 +65,8 @@ services:
- ./env/postgres.env
expose:
- "5432"
networks:
- tubearchivist_network
# umami stats
umami:
image: ghcr.io/mikecao/umami:postgresql-latest
@ -68,6 +81,8 @@ services:
depends_on:
- umami-db
restart: always
networks:
- umami_network
umami-db:
image: postgres:14
container_name: umami-db
@ -77,3 +92,43 @@ services:
- ./volume/umami/schema.postgresql.sql:/docker-entrypoint-initdb.d/schema.postgresql.sql:ro
- ./volume/umami/db:/var/lib/postgresql/data
restart: always
networks:
- umami_network
# drone build server
drone:
image: drone/drone:2
container_name: drone
expose:
- "80"
env_file:
- ./env/drone.env
environment:
- VIRTUAL_HOST=www.drone.tubearchivist.com,drone.tubearchivist.com
- LETSENCRYPT_HOST=www.drone.tubearchivist.com,drone.tubearchivist.com
volumes:
- ./volume/drone/server:/data
restart: always
networks:
- drone_network
drone-runner:
image: drone/drone-runner-docker
container_name: drone-runner
expose:
- "3000"
env_file:
- ./env/drone.env
volumes:
- /var/run/docker.sock:/var/run/docker.sock
restart: always
networks:
- drone_network
networks:
front:
driver: bridge
tubearchivist_network:
driver: bridge
umami_network:
driver: bridge
drone_network:
driver: bridge

9
env/drone.sample.env vendored Normal file
View File

@ -0,0 +1,9 @@
DRONE_GITHUB_CLIENT_ID=aaaaaaaaaaaa
DRONE_GITHUB_CLIENT_SECRET=bbbbbbbbbbbbbbbbb
DRONE_RPC_SECRET=ccccccccccccc
DRONE_SERVER_HOST=www.drone.tubearchivist.com
DRONE_SERVER_PROTO=https
DRONE_RUNNER_CAPACITY=1
DRONE_RUNNER_NAME=tubearchivist
DRONE_RPC_PROTO=https
DRONE_RPC_HOST=www.drone.tubearchivist.com