Skip to content

Commit

Permalink
traefik-refactoring-to-yml (#6): done; hxl-proxy (#2): container at l…
Browse files Browse the repository at this point in the history
…east don't die (was error on command);
  • Loading branch information
fititnt committed Apr 7, 2020
1 parent 2e83bef commit 8618229
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 46 deletions.
3 changes: 0 additions & 3 deletions ansible/inventories/.gitignore

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@
# See https://docs.traefik.io/user-guides/docker-compose/basic-example/
# See https://docs.traefik.io/user-guides/docker-compose/acme-tls/

# TODO: this fine, if on the inventory dir, will return errors; Fix this
# layout structure later (fititnt, 2020-04-07 00:29 BRT)

global:
checkNewVersion: true
sendAnonymousUsage: false
Expand All @@ -15,6 +12,20 @@ entryPoints:
address: ":80"
websecure:
address: ":443"

## TODO: learn how to implement middlewares on Traefik 2.2 and then do an default
# redirect http to https that could be referenced on docker-compose
# containers (fititnt, 2020-04-07 01:34)

# @see https://docs.traefik.io/middlewares/redirectscheme/
# Redirect to https
# http:
# middlewares:
# test-redirectscheme:
# redirectScheme:
# scheme: https
# #permanent: true

log:
level: "DEBUG" # level: "ERROR"

Expand Down
14 changes: 1 addition & 13 deletions ansible/inventories/etica.dev/hosts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,19 +23,7 @@ all:
traefik_version: "2.2.0"
traefik_arch: "linux_amd64"
traefik_force_reinstall: yes
traefik_conf_yml: "{{ playbook_dir }}/../inventories/etica.dev/traefik/traefik.yml"

# traefik_api_dashboard: true
# traefik_api_insecure: true

# traefik_acme_enabled: true
# traefik_acme_email: "[email protected]"

## To force reinstall / update the traefik, please set this to yes
# traefik_force_reinstall: yes
# traefik_force_reinstall: yes
# traefik_debug_devel: yes
# trafik_log_level: "DEBUG"
traefik_conf_yml: "{{ playbook_dir }}/../inventories/etica.dev-extras/traefik/traefik.yml"

# @see https://github.com/geerlingguy/ansible-role-pip#role-variables
# By default, geerlingguy.pip will use pip from python 2.7.
Expand Down
13 changes: 2 additions & 11 deletions ansible/playbooks/docker-full-stack-start.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,8 @@
hosts: all
gather_facts: yes
tasks:
# - name: Tear down existing services
# docker_compose:
# project_src: flask
# state: absent

# - name: "docker-full-stack-start | debug"
# debug:
# msg: "{{ playbook_dir }}/../../docker/full-stack/"
# # var: "{{ playbook_dir }}/../../docker/full-stack/"

- name: "docker-full-stack-start| Copy docker/full-stack/ to [ansible user home]/full-stack/"
- name: "docker-full-stack-start | Copy docker/full-stack/ to [ansible user home]/full-stack/"
copy:
src: "{{ playbook_dir }}/../../docker/full-stack/"
dest: "{{ ansible_env.HOME }}/full-stack/"
Expand All @@ -35,7 +26,7 @@
services:
# - hello
- whoami
# - hxl-proxy
- hxl-proxy
register: output

- name: "docker-full-stack-start | services result"
Expand Down
2 changes: 1 addition & 1 deletion ansible/playbooks/roles/traefik/tasks/configure.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

# - name: "Deploy traefik.toml"
# template:
# src: "traefik.toml.j2"
# src: "traefik.yml.j2"
# dest: "/etc/traefik/traefik.toml"
# mode: 0664
# block_start_string: "[[[%"
Expand Down
33 changes: 18 additions & 15 deletions docker/full-stack/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,21 +24,24 @@ services:
- "traefik.http.routers.whoami.rule=Host(`whoami.hxl.etica.dev`)"
- "traefik.http.routers.whoami.entrypoints=web,websecure"
- "traefik.http.routers.whoami.tls.certresolver=letsencrypt"
# - traefik.http.routers.http.rule=Host(`${DOMAIN}`)
# - traefik.http.routers.http.entrypoints=web,websecure
# - traefik.http.routers.http.middlewares=redirect
# - traefik.http.routers.https.rule=Host(`${DOMAIN}`)
# - traefik.http.routers.https.entrypoints=https
# - traefik.http.routers.https.tls=true
# - traefik.http.routers.https.tls.certresolver=${HTPPS_CERTIFICATE_RESOLVER}
# - traefik.http.routers.http.entrypoints=web,websecure
# TODO: implement middleware 'redirect HTTP to HTTPS' (fititnt, 2020-04-07 00>39 BRT)
# - "traefik.http.routers.http.middlewares=redirect"

# TODO: make it work
# @see https://github.com/HXLStandard/hxl-proxy/blob/master/docker_files/docker-compose.yml
hxl-proxy:
# image: unocha/hxl-proxy:latest
image: unocha/hxl-proxy:dev
command: python manage.py runserver 0.0.0.0:8000
depends_on:
- postgres_hxl-proxy
# image: unocha/hxl-proxy:dev
image: unocha/hxl-proxy:1.18 # see https://hub.docker.com/r/unocha/hxl-proxy/tags
# command: python manage.py runserver 0.0.0.0:8000
# depends_on:
# - postgres_hxl-proxy
labels:
- "traefik.enable=true"
- "traefik.http.routers.hxl-proxy.rule=Host(`proxy.hxl.etica.dev`)"
- "traefik.http.routers.hxl-proxy.entrypoints=web,websecure"
- "traefik.http.routers.hxl-proxy.tls.certresolver=letsencrypt"
# TODO: implement middleware 'redirect HTTP to HTTPS' (fititnt, 2020-04-07 00>39 BRT)
# - "traefik.http.routers.http.middlewares=redirect"

postgres_hxl-proxy:
image: postgres
# postgres_hxl-proxy:
# image: postgres

0 comments on commit 8618229

Please sign in to comment.