firsts stacks

This commit is contained in:
Maciej Krok 2019-09-14 10:49:59 +02:00
commit fd5977812e
5 changed files with 224 additions and 0 deletions

0
README.md Normal file
View File

View File

@ -0,0 +1,28 @@
version: '3.4'
services:
luxmedbookingservice:
image: eugenezadyra/luxmed-bot:latest-arm
environment:
- SECURITY_SECRET=${SECURITY_SECRET}
- TELEGRAM_TOKEN=${TELEGRAM_TOKEN}
- DB_HOST=database
volumes:
- lbs:/lbs
database:
image: postgres:10.6
volumes:
- postgres:/var/lib/postgresql/data
environment:
- POSTGRES_USER=lbs
- POSTGRES_PASSWORD=lsb123
- POSTGRES_DB=lbs
- TZ=Europe/Warsaw
volumes:
postgres:
lbs:
### Environment variables
# SECURITY_SECRET
# TELEGRAM_TOKEN

72
nextcloud/nextcloud.yaml Normal file
View File

@ -0,0 +1,72 @@
version: '3'
services:
db:
image: postgres:latest
volumes:
- db_data:/var/lib/postgresql/data
environment:
- POSTGRES_USER=nextcloud
- POSTGRES_PASSWORD=nextcloud
- POSTGRES_DB=notthis
networks:
- internal
deploy:
replicas: 1
restart_policy:
condition: on-failure
delay: 5s
nextcloud:
image: nextcloud:latest
environment:
- POSTGRES_USER=nextcloud
- POSTGRES_PASSWORD=nextcloud
- POSTGRES_DB=nextcloud
- POSTGRES_HOST=db:5432
volumes:
- nextcloud:/var/www/html
- apps:/var/www/html/custom_apps
- config:/var/www/html/config
- data:/var/www/html/data
networks:
- internal
- external
- traefik-net
deploy:
mode: replicated
replicas: 1
restart_policy:
condition: on-failure
delay: 5s
labels:
traefik.enable: "true"
traefik.frontend.rule: "Host:${HOST}"
traefik.port: 80
traefik.docker.network: traefik-net
traefik.frontend.headers.STSSeconds: 63072000
traefik.frontend.headers.STSIncludeSubdomains: "true"
traefik.frontend.headers.STSPreload: "true"
traefik.frontend.redirect.permanent: 'true'
traefik.frontend.redirect.regex: https://(.*)/.well-known/(card|cal)dav
traefik.frontend.redirect.replacement: https://$$1/remote.php/dav/
volumes:
db_data:
nextcloud:
apps:
config:
data:
networks:
external:
internal:
driver: overlay
internal: true
traefik-net:
external: true
### Environment variables
# HOST

61
traefik/traefik.yaml Normal file
View File

@ -0,0 +1,61 @@
version: '3.3'
services:
reverse-proxy:
image: traefik
command:
- --defaultentrypoints=https,http
- --api
- --api.entryPoint=traefik
- --api.dashboard=false
- --debug=false
- --entryPoints=Name:http Address::80 Redirect.EntryPoint:https
- --entryPoints=Name:https Address::443 TLS
- --logLevel=INFO
- --accessLog.format=json
- --docker
- --docker.endpoint=unix:///var/run/docker.sock
- --docker.domain=${DOCKER_DOMAIN}
- --docker.swarmmode=true
- --docker.watch=true
- --docker.exposedbydefault=false
- --acme.email=${ACME_EMAIL}
- --acme.storage=/acme/acme.json
- --acme.entryPoint=https
- --acme.onHostRule=true
- --acme.httpChallenge.entryPoint=http
ports:
- target: 80
published: 80
protocol: tcp
mode: host
- target: 443
published: 443
protocol: tcp
mode: host
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- acmeData:/acme
- tmp:/tmp
networks:
- traefik-net
deploy:
mode: global
placement:
constraints:
- node.role == manager
networks:
traefik-net:
driver: overlay
external: true
volumes:
acmeData:
tmp:
### Environment variables
# DOCKER_DOMAIN
# ACME_EMAIL

63
wordpress/wordpress.yaml Normal file
View File

@ -0,0 +1,63 @@
version: '3'
services:
db:
image: ofthesun9/mysql:5.7
volumes:
- db_data:/var/lib/mysql
environment:
MYSQL_ROOT_PASSWORD: wordpress
MYSQL_DATABASE: wordpress
MYSQL_USER: wordpress
MYSQL_PASSWORD: wordpress
networks:
- internal
deploy:
replicas: 1
restart_policy:
condition: on-failure
delay: 5s
wordpress:
image: wordpress:latest
environment:
WORDPRESS_DB_HOST: db:3306
WORDPRESS_DB_USER: wordpress
WORDPRESS_DB_PASSWORD: wordpress
networks:
- internal
- external
- traefik-net
volumes:
- wordpress_data:/var/www/html
deploy:
mode: replicated
replicas: 1
restart_policy:
condition: on-failure
delay: 5s
labels:
traefik.enable: "true"
traefik.frontend.rule: "Host:${HOST}"
traefik.port: 80
traefik.docker.network: traefik-net
traefik.frontend.headers.STSSeconds: 63072000
traefik.frontend.headers.STSIncludeSubdomains: "true"
traefik.frontend.headers.STSPreload: "true"
volumes:
db_data:
wordpress_data:
networks:
external:
internal:
driver: overlay
internal: true
traefik-net:
external: true
### Environment variables
# HOST