-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplaybook.yaml
More file actions
62 lines (54 loc) · 1.46 KB
/
Copy pathplaybook.yaml
File metadata and controls
62 lines (54 loc) · 1.46 KB
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
- name: Deyploy the predictor api to EC2 server
hosts: apiserver
become: True
vars:
# MODEL_CONFIG_PATH: /home/ec2-user/model_config/all_model.yaml
user_home: /home/ec2-user
server_home: /home/ec2-user
tasks:
- name: Install aptitude
apt:
name: aptitude
state: latest
update_cache: true
- name: Install required system packages
apt:
pkg:
- apt-transport-https
- ca-certificates
- curl
- software-properties-common
- python3-pip
- virtualenv
- python3-setuptools
state: latest
update_cache: true
- name: Add Docker GPG apt Key
apt_key:
url: https://download.docker.com/linux/ubuntu/gpg
state: present
- name: Add Docker Repository
apt_repository:
repo: deb https://download.docker.com/linux/ubuntu focal stable
state: present
- name: Update apt and install docker-ce
apt:
name:
- docker-ce
- docker-compose-plugin
state: latest
update_cache: true
- name: Start docker service
service:
name: docker
state: started
- name: Enable docker service
service:
name: docker
enabled: yes
- name: Copy docker-compose.yaml to server
copy:
src: docker-compose.yaml
dest: "{{ server_home }}"
- name: Run the server
command: docker-compose up