Compare commits
No commits in common. "9f8b762fa7b72c5d964ca420e4daebb830b5ee43" and "b4b75e9de339ce79887ef7769bf4b3b307519a04" have entirely different histories.
9f8b762fa7
...
b4b75e9de3
3 changed files with 5 additions and 40 deletions
|
@ -1,7 +1,7 @@
|
||||||
---
|
---
|
||||||
services:
|
services:
|
||||||
booklore:
|
booklore:
|
||||||
image: booklore/booklore:${BOOKLORE_VERSION:-latest}
|
image: ghcr.io/adityachandelgit/booklore-app:${BOOKLORE_VERSION:-latest}
|
||||||
container_name: booklore
|
container_name: booklore
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
depends_on:
|
depends_on:
|
||||||
|
|
|
@ -3,17 +3,14 @@
|
||||||
######################
|
######################
|
||||||
container_traefik_url: "traefik.example.com"
|
container_traefik_url: "traefik.example.com"
|
||||||
container_traefik_version: "latest"
|
container_traefik_version: "latest"
|
||||||
container_traefik_http_port: 8080
|
container_traefik_basicuser: "admin"
|
||||||
container_traefik_https_port: 8443
|
container_traefik_basicpassword: "changeme"
|
||||||
|
container_traefik_http_port: 80
|
||||||
|
container_traefik_https_port: 443
|
||||||
container_traefik_auth: "basic" # Options: basic, sso
|
container_traefik_auth: "basic" # Options: basic, sso
|
||||||
container_traefik_dashboard_enabled: false
|
container_traefik_dashboard_enabled: false
|
||||||
container_traefik_letsencrypt_email: "mail@example.com"
|
container_traefik_letsencrypt_email: "mail@example.com"
|
||||||
|
|
||||||
# To create user:password pair for basic Auth, it's possible to use this command:
|
|
||||||
# echo $(htpasswd -nB user) | sed -e s/\\$/\\$\\$/g
|
|
||||||
container_traefik_basicuser: "admin"
|
|
||||||
container_traefik_basicpassword: "changeme"
|
|
||||||
|
|
||||||
container_traefik_routers:
|
container_traefik_routers:
|
||||||
dummy:
|
dummy:
|
||||||
entryPoints: ["https"]
|
entryPoints: ["https"]
|
||||||
|
|
|
@ -4,8 +4,6 @@
|
||||||
path: "{{ container_base_dir }}/data/{{ item }}"
|
path: "{{ container_base_dir }}/data/{{ item }}"
|
||||||
state: directory
|
state: directory
|
||||||
mode: '0755'
|
mode: '0755'
|
||||||
owner: "{{ ansible_user }}"
|
|
||||||
group: "{{ ansible_user }}"
|
|
||||||
loop:
|
loop:
|
||||||
- "certs"
|
- "certs"
|
||||||
- "config.d"
|
- "config.d"
|
||||||
|
@ -16,8 +14,6 @@
|
||||||
path: "{{ container_base_dir }}/data/logs/{{ item }}"
|
path: "{{ container_base_dir }}/data/logs/{{ item }}"
|
||||||
state: touch
|
state: touch
|
||||||
mode: '0644'
|
mode: '0644'
|
||||||
owner: "{{ ansible_user }}"
|
|
||||||
group: "{{ ansible_user }}"
|
|
||||||
loop:
|
loop:
|
||||||
- "traefik.log"
|
- "traefik.log"
|
||||||
- "access.log"
|
- "access.log"
|
||||||
|
@ -27,8 +23,6 @@
|
||||||
path: "{{ container_base_dir }}/data/certs/{{ item }}"
|
path: "{{ container_base_dir }}/data/certs/{{ item }}"
|
||||||
state: touch
|
state: touch
|
||||||
mode: '0600'
|
mode: '0600'
|
||||||
owner: "{{ ansible_user }}"
|
|
||||||
group: "{{ ansible_user }}"
|
|
||||||
loop:
|
loop:
|
||||||
- "acme.json"
|
- "acme.json"
|
||||||
|
|
||||||
|
@ -45,8 +39,6 @@
|
||||||
src: "{{ item.src }}"
|
src: "{{ item.src }}"
|
||||||
dest: "{{ container_base_dir }}/data/{{ item.dest }}"
|
dest: "{{ container_base_dir }}/data/{{ item.dest }}"
|
||||||
mode: '0644'
|
mode: '0644'
|
||||||
owner: "{{ ansible_user }}"
|
|
||||||
group: "{{ ansible_user }}"
|
|
||||||
loop:
|
loop:
|
||||||
- { src: 'middlewares.yml', dest: 'config.d/middlewares.yml' }
|
- { src: 'middlewares.yml', dest: 'config.d/middlewares.yml' }
|
||||||
become: false
|
become: false
|
||||||
|
@ -56,37 +48,16 @@
|
||||||
src: "{{ item.src }}"
|
src: "{{ item.src }}"
|
||||||
dest: "{{ container_base_dir }}/{{ item.dest }}"
|
dest: "{{ container_base_dir }}/{{ item.dest }}"
|
||||||
mode: '0644'
|
mode: '0644'
|
||||||
owner: "{{ ansible_user }}"
|
|
||||||
group: "{{ ansible_user }}"
|
|
||||||
loop:
|
loop:
|
||||||
- { src: 'docker-compose.yml.j2', dest: 'docker-compose.yml' }
|
- { src: 'docker-compose.yml.j2', dest: 'docker-compose.yml' }
|
||||||
- { src: '.env.j2', dest: '.env' }
|
- { src: '.env.j2', dest: '.env' }
|
||||||
- { src: 'routers_services.yml.j2', dest: 'data/config.d/routers_services.yml' }
|
- { src: 'routers_services.yml.j2', dest: 'data/config.d/routers_services.yml' }
|
||||||
- { src: 'traefik.yml.j2', dest: 'data/traefik.yml' }
|
- { src: 'traefik.yml.j2', dest: 'data/traefik.yml' }
|
||||||
|
|
||||||
- name: Redirect privileged ports 80 and 443 to 8080 and 8443
|
|
||||||
become: true
|
|
||||||
ansible.builtin.iptables:
|
|
||||||
table: nat
|
|
||||||
chain: PREROUTING
|
|
||||||
protocol: tcp
|
|
||||||
destination_port: "{{ item.src_port }}"
|
|
||||||
jump: REDIRECT
|
|
||||||
to_ports: "{{ item.dst_port }}"
|
|
||||||
loop:
|
|
||||||
- { src_port: 80, dst_port: "{{ container_traefik_http_port }}" }
|
|
||||||
- { src_port: 443, dst_port: "{{ container_traefik_https_port }}" }
|
|
||||||
when: >
|
|
||||||
(container_traefik_http_port| int != 80) or
|
|
||||||
(container_traefik_https_port | int != 443)
|
|
||||||
|
|
||||||
- name: Stop Container
|
- name: Stop Container
|
||||||
community.docker.docker_compose_v2:
|
community.docker.docker_compose_v2:
|
||||||
project_src: "{{ container_base_dir }}"
|
project_src: "{{ container_base_dir }}"
|
||||||
state: absent
|
state: absent
|
||||||
environment:
|
|
||||||
XDG_RUNTIME_DIR: "/run/user/1000"
|
|
||||||
DOCKER_HOST: "unix:///run/user/1000/docker.sock"
|
|
||||||
|
|
||||||
- name: Start Container
|
- name: Start Container
|
||||||
community.docker.docker_compose_v2:
|
community.docker.docker_compose_v2:
|
||||||
|
@ -94,6 +65,3 @@
|
||||||
state: present
|
state: present
|
||||||
pull: always
|
pull: always
|
||||||
recreate: always
|
recreate: always
|
||||||
environment:
|
|
||||||
XDG_RUNTIME_DIR: "/run/user/1000"
|
|
||||||
DOCKER_HOST: "unix:///run/user/1000/docker.sock"
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue