fix cloud init

This commit is contained in:
nlitkowski 2021-11-27 14:24:18 +01:00
parent 555aeb0bac
commit d1b81ccdad

View File

@ -1,19 +1,14 @@
#cloud-config #cloud-config
# lista podstawowych pakietów, które należy zainstalować
packages: packages:
- apt-transport-https - apt-transport-https
- ca-certificates - ca-certificates
- curl - curl
- gnupg-agent - gnupg-agent
- software-properties-common - software-properties-common
# tworzymy plik docker-compose.yml
write_files: write_files:
- path: /root/docker-compose.yml - path: /root/docker-compose.yml
content: | content: |
version: '3.9' version: '3.9'
services: services:
db: db:
image: mysql:5.7 image: mysql:5.7
@ -21,23 +16,20 @@ write_files:
ports: ports:
- "10.10.10.2:3306:3306" - "10.10.10.2:3306:3306"
environment: environment:
MYSQL_ROOT_PASSWORD: notSecureChangeMe MYSQL_ROOT_PASSWORD: gitea
MYSQL_DATABASE: wordpress MYSQL_DATABASE: gitea
MYSQL_USER: wordpress MYSQL_USER: gitea
MYSQL_PASSWORD: wordpress MYSQL_PASSWORD: gitea
volumes: volumes:
- db_data:/var/lib/mysql - db_data:/var/lib/mysql
phpmyadmin: phpmyadmin:
image: phpmyadmin image: phpmyadmin
restart: always restart: always
# przekierowanie portów zostawione tylko dla przykładu, nie należy tak robić na produkcji
ports: ports:
- "8080:80" - "8080:80"
volumes: volumes:
db_data: {} db_data: {}
# instalujemy docker, docker-compose a następnie uruchamiamy naszą bazę danych
runcmd: runcmd:
- curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add - - curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add -
- add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" - add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"