forked from edureka-git/DevOpsClassCodes
-
Notifications
You must be signed in to change notification settings - Fork 60
Expand file tree
/
Copy pathdeploy-docker.yml
More file actions
35 lines (30 loc) · 714 Bytes
/
deploy-docker.yml
File metadata and controls
35 lines (30 loc) · 714 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
---
- hosts: dev
become: True
tasks:
- name: install python pip
apt:
name: python-pip
state: present
- name: Install docker with python module
pip:
name: docker-py
state: present
- name: Install docker
apt:
name: docker
state: present
- name: start docker
service:
name: docker
state: started
enabled: yes
- name: docker run user
shell: usermod -a -G docker ubuntu
- name: Start the container
docker_container:
name: project-app
image: "cbabu85/addressbook"
state: started
published_ports:
- 0.0.0.0:8090:8090