DPZC-IaaS-3.2/aws/db.yaml
2021-11-26 14:25:25 +01:00

42 lines
1.4 KiB
YAML

#cloud-config
packages:
- apt-transport-https
- ca-certificates
- curl
- gnupg-agent
- software-properties-common
write_files:
- path: /root/docker-compose.yml
content: |
version: '3.9'
services:
db:
image: postgres:13
restart: always
environment:
- POSTGRES_USER=gitea
- POSTGRES_PASSWORD=gitea
- POSTGRES_DB=gitea
ports:
- "5432:5432"
volumes:
- ./postgres:/var/lib/postgresql/data
volumes:
postgres_data:
driver_opts:
type: "nfs4"
o: "addr=${fes_address},nolock,soft,rw"
device: ":/docker/postgres_data"
# instalujemy docker, docker-compose a następnie uruchamiamy naszą bazę danych
runcmd:
- 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"
- apt-get update -y
- apt-get install -y docker-ce docker-ce-cli containerd.io
- curl -L "https://github.com/docker/compose/releases/download/1.29.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
- chmod +x /usr/local/bin/docker-compose
- systemctl start docker
- systemctl enable docker
- cd /root/ && docker-compose up -d