-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathansible.yml
More file actions
40 lines (34 loc) · 990 Bytes
/
ansible.yml
File metadata and controls
40 lines (34 loc) · 990 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
---
- name: Deploy GeulDa App (Blue/Green)
hosts: all
become: yes
vars:
image_name: "kyumin19/geulda-be:latest"
container_name: "geulda-app"
health_url: "http://localhost:{{ app_port }}/actuator/health"
tasks:
- name: Stop existing container
shell: docker rm -f {{ container_name }} 2>/dev/null || true
- name: Pull latest docker image
shell: docker pull {{ image_name }}
- name: Run new container
shell: |
docker run -d \
--name {{ container_name }} \
--env-file /home/ubuntu/.env \
-p {{ app_port }}:8080 \
--memory="550m" \
--memory-reservation="400m" \
--memory-swap="550m" \
--oom-kill-disable=false \
--restart unless-stopped \
{{ image_name }}
- name: Health Check
uri:
url: "{{ health_url }}"
method: GET
status_code: 200
register: result
retries: 12
delay: 5
until: result.status == 200