Remove shopping_list_api Ansible role
Moved to infrastructure/ansible.
This commit is contained in:
@@ -1,9 +0,0 @@
|
||||
---
|
||||
shopping_list_api_base_path: "{{ base_config_dir }}/shopping-list-api"
|
||||
shopping_list_api_data_path: "{{ shopping_list_api_base_path }}/data"
|
||||
|
||||
shopping_list_api_image: "git.danhenry.dev/thelab/shopping-list-api:{{ shopping_list_api_image_tag }}"
|
||||
shopping_list_api_image_tag: "latest"
|
||||
|
||||
shopping_list_api_proxy_port: 8002
|
||||
shopping_list_api_container_port: 8000
|
||||
@@ -1,5 +0,0 @@
|
||||
---
|
||||
- name: Restart Shopping List API
|
||||
community.docker.docker_compose_v2:
|
||||
project_src: "{{ shopping_list_api_base_path }}"
|
||||
state: restarted
|
||||
@@ -1,3 +0,0 @@
|
||||
---
|
||||
dependencies:
|
||||
- role: docker
|
||||
@@ -1,34 +0,0 @@
|
||||
---
|
||||
- name: Create Shopping List API directories
|
||||
ansible.builtin.file:
|
||||
path: "{{ item }}"
|
||||
state: directory
|
||||
owner: "{{ docker_uid }}"
|
||||
group: "{{ docker_gid }}"
|
||||
mode: '0755'
|
||||
loop:
|
||||
- "{{ shopping_list_api_base_path }}"
|
||||
- "{{ shopping_list_api_data_path }}"
|
||||
|
||||
- name: Deploy docker-compose.yml
|
||||
ansible.builtin.template:
|
||||
src: docker-compose.yml.j2
|
||||
dest: "{{ shopping_list_api_base_path }}/docker-compose.yml"
|
||||
owner: "{{ docker_uid }}"
|
||||
group: "{{ docker_gid }}"
|
||||
mode: '0600'
|
||||
notify: Restart Shopping List API
|
||||
|
||||
- name: Deploy nginx reverse proxy config
|
||||
ansible.builtin.template:
|
||||
src: nginx.conf.j2
|
||||
dest: "{{ shopping_list_api_base_path }}/nginx.conf"
|
||||
owner: "{{ docker_uid }}"
|
||||
group: "{{ docker_gid }}"
|
||||
mode: '0644'
|
||||
notify: Restart Shopping List API
|
||||
|
||||
- name: Deploy Shopping List API stack
|
||||
community.docker.docker_compose_v2:
|
||||
project_src: "{{ shopping_list_api_base_path }}"
|
||||
state: present
|
||||
@@ -1,27 +0,0 @@
|
||||
---
|
||||
services:
|
||||
api:
|
||||
image: {{ shopping_list_api_image }}
|
||||
environment:
|
||||
- DB_PATH=/app/data/shopping.db
|
||||
volumes:
|
||||
- {{ shopping_list_api_data_path }}:/app/data
|
||||
restart: unless-stopped
|
||||
healthcheck:
|
||||
test: ["CMD", "wget", "-qO-", "http://localhost:{{ shopping_list_api_container_port }}/health"]
|
||||
interval: 30s
|
||||
timeout: 10s
|
||||
retries: 3
|
||||
expose:
|
||||
- "{{ shopping_list_api_container_port }}"
|
||||
|
||||
proxy:
|
||||
image: nginx:alpine
|
||||
ports:
|
||||
- "{{ shopping_list_api_proxy_port }}:80"
|
||||
volumes:
|
||||
- ./nginx.conf:/etc/nginx/conf.d/default.conf:ro
|
||||
depends_on:
|
||||
api:
|
||||
condition: service_healthy
|
||||
restart: unless-stopped
|
||||
@@ -1,12 +0,0 @@
|
||||
server {
|
||||
listen 80;
|
||||
server_name _;
|
||||
|
||||
location / {
|
||||
proxy_pass http://api:{{ shopping_list_api_container_port }};
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header X-Forwarded-Proto $scheme;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user