Update roles/build_fastapi/tasks/main.yml

This commit is contained in:
2024-02-02 16:39:00 +08:00
parent b935f29f11
commit 5a9e29b135

View File

@@ -34,3 +34,22 @@
path: "{{ build_root_abspath }}"
pull: false
tag: "{{ demobackend_version }}"
- name: run docker
community.docker.docker_container:
name: demobackend
state: started
recreate: yes
image: "helloworld-fastapi:{{ demobackend_version }}"
ports:
- "8080:8080"
- name: wait for the api ready
wait_for:
host: 0.0.0.0
port: 8080
delay: 10
- name: testing api locally
shell: "curl -k localhost:8080"
register: reg_curl_result
- name: show curl result
debug:
msg: "{{ reg_curl_result.stdout }}"