-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker.yml.old
148 lines (128 loc) · 4.92 KB
/
docker.yml.old
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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
---
- name: DOCKER
hosts: localhost
tasks:
- name: Install required system packages
become: true
apt: name={{ item }} state=latest
loop: [ 'apt-transport-https', 'lsb-release', 'python-pip', 'ca-certificates', 'curl', 'sudo', 'software-properties-common', 'python3-pip', 'virtualenv', 'python3-setuptools']
- name: Add php
become: true
get_url:
url: "https://packages.sury.org/php/apt.gpg"
dest: /etc/apt/trusted.gpg.d/php.gpg
- name: Add php(2)
become: true
shell: echo "deb https://packages.sury.org/php/ $(lsb_release -sc) main" >> /etc/apt/sources.list.d/php.list
- name: Upgrade package
become: true
apt:
update_cache: yes
upgrade: yes
- name: Install Php
become: true
apt: name={{ item }} update_cache=yes state=latest
loop: [ 'php7.3-curl', 'php7.3-gd', 'php7.3-intl', 'php7.3-json', 'php7.3-mbstring', 'php7.3-xml', 'php7.3-zip', 'php7.3', 'composer', 'python-apt' ]
- name: Config Sudo
template: src=templates/sudo.j2 dest=/etc/sudoers
- name: Composer install
become: yes
become_user: trr
command: sudo composer -d=/root/docker/rendu-healtheat/apps/my-symfony-app/ install
- name: ADD Docker GPG apt Key
become: true
apt_key:
url: https://download.docker.com/linux/debian/gpg
state: present
- name: Add Docker Repository for Debian 10
become: true
apt_repository:
repo: deb https://download.docker.com/linux/debian buster stable
state: present
when: (ansible_distribution == "Debian") and
(ansible_distribution_major_version == "10")
- name: Add Docker Repository for Debian 9
become: true
apt_repository:
repo: deb https://download.docker.com/linux/debian stretch stable
state: present
when: (ansible_distribution == "Debian") and
(ansible_distribution_major_version == "9")
- name: Update apt and install docker-ce
become: true
apt: name=docker-ce state=latest
- name: Install Docker Module for Python
become: true
pip:
name: docker
- name: Retrieving docker-compose
become: true
command: sudo curl -L "https://github.com/docker/compose/releases/download/1.25.0/docker-compose-Linux-x86_64" -o /usr/local/bin/docker-compose
- name: Giving permission to docker-compose
become: true
file:
path: /usr/local/bin/docker-compose
state: touch
mode: u+x
- name: Create a sym link
become: true
file:
src: /usr/local/bin/docker-compose
dest: /usr/bin/docker-compose
state: link
- name: Network
become: true
docker_network:
name: ndi
- name: MYSQL Container
become: true
docker_container:
name: mysql
image: mysql:5
networks:
- name: ndi
restart_policy: always
state: 'started'
env:
MYSQL_USER: 'root'
MYSQL_PASSWORD: ''
MYSQL_ROOT_PASSWORD: ''
MYSQL_DATABASE: 'nightInfo'
MYSQL_PORT: '9000'
port: '9000:9000'
volumes: './data/mysql:/var/lib/mysql'
- name: PHP Image
become: true
command: docker build . -f docker/php/Dockerfile -t php
- name: PHP Container
become: true
docker_container:
name: php
hostname: php
image: php
networks:
- name: ndi
restart_policy: on-failure
state: 'started'
volumes:
- ./apps/my-symfony-app/:/usr/src/app
- ./point.env:/usr/src/app/.env
env_file: ./.env
- name: Waiting
become: true
shell: 'sleep 5 ; echo "Fin du sleep!!" '
- name: NGINX Container
become: true
docker_container:
name: nginx
image: nginx:1.15.3-alpine
networks:
- name: ndi
restart_policy: on-failure
state: 'started'
volumes:
- ./apps/my-symfony-app/:/usr/src/app
- ./docker/nginx/default.conf:/etc/nginx/conf.d/default.conf:ro
- ./docker/nginx/mimes.types:/etc/nginx/conf.d/mimes.types
ports:
- "8080:80"