diff --git a/docker-swarm/app.yml b/docker-swarm/app.yml index 428298f..e3b6220 100644 --- a/docker-swarm/app.yml +++ b/docker-swarm/app.yml @@ -4,7 +4,9 @@ services: app: image: skaut/snem-volby:latest volumes: - - sessions:/var/www/html/temp/sessions + - /srv/app-sessions:/var/www/html/temp/sessions + - /srv/app-log:/var/www/html/log + - /srv/app-temp:/var/www/html/temp networks: - traefik configs: @@ -19,7 +21,7 @@ services: cpus: "0.50" memory: "512M" labels: - traefik.frontend.rule: 'Host:zmenastanov.skaut.cz,www.zmenastanov.skaut.cz' + traefik.frontend.rule: 'Host:volby.skaut.cz,www.volby.skaut.cz' traefik.port: '80' traefik.docker.network: traefik swarmpit.service.deployment.autoredeploy: 'true' @@ -35,6 +37,3 @@ networks: configs: dev-config.local.neon-v2: external: true - -volumes: - sessions: diff --git a/docker-swarm/traefik.yml b/docker-swarm/traefik.yml new file mode 100644 index 0000000..d8e3a9e --- /dev/null +++ b/docker-swarm/traefik.yml @@ -0,0 +1,51 @@ +version: '3.4' +services: + traefik: + image: traefik:1.7.24 + command: | + --api \ + --web \ + --logLevel=warn \ + --entryPoints="Name:http Address::80 Redirect.EntryPoint:https" \ + --entryPoints="Name:https Address::443 TLS" \ + --defaultentrypoints="http,https" \ + --acme.storage=/acme/acme.json \ + --acme=true \ + --acme.entrypoint=https \ + --acme.httpchallenge \ + --acme.httpchallenge.entrypoint=http \ + --acme.domains="volby.skaut.cz,www.volby.skaut.cz" \ + --acme.email="sinacek@gmail.com" \ + --docker \ + --docker.watch=true \ + --docker.swarmmode + + ports: + - 80:80 + - 443:443 + - 9999:8080 + volumes: + - /var/run/docker.sock:/var/run/docker.sock + - traefik_acme:/acme + networks: + - traefik + deploy: + placement: + constraints: + - node.role==manager + update_config: + order: start-first + resources: + reservations: + cpus: "0.05" + memory: "10M" + limits: + cpus: "0.5" + memory: "200M" + +volumes: + traefik_acme: + +networks: + traefik: + external: true