Compare commits
No commits in common. "4a5268780a0a875f1370e39d3a233073bcd61d00" and "440e9291b313ca3ea6a2a738c14f75485b4b70d0" have entirely different histories.
4a5268780a
...
440e9291b3
@ -30,8 +30,7 @@ write_files:
|
||||
restart: always
|
||||
|
||||
volumes:
|
||||
- /mnt/VOLUME_NAME/data:/var/lib/gitea
|
||||
- /mnt/VOLUME_NAME/config:/etc/gitea
|
||||
- ./gitea:/data
|
||||
- /etc/timezone:/etc/timezone:ro
|
||||
- /etc/localtime:/etc/localtime:ro
|
||||
|
||||
@ -48,11 +47,4 @@ runcmd:
|
||||
- chmod +x /usr/local/bin/docker-compose
|
||||
- systemctl start docker
|
||||
- systemctl enable docker
|
||||
- sudo mkfs.ext4 -F /dev/disk/by-id/scsi-0HC_Volume_{volume.volume.id}
|
||||
- mkdir /mnt/{volume_name}
|
||||
- mount -o discard,defaults /dev/disk/by-id/scsi-0HC_Volume_{volume.volume.id} /mnt/{volume_name}
|
||||
- echo "/dev/disk/by-id/scsi-0HC_Volume_{volume.volume.id} /mnt/{volume_name} ext4 discard,nofail,defaults 0 0" >> /etc/fstab
|
||||
- mkdir /mnt/{volume_name}/data
|
||||
- mkdir /mnt/{volume_name}/config
|
||||
- sudo chown 1000:1000 /mnt/{volume_name}/config/ /mnt/{volume_name}/data
|
||||
- cd /root/ && docker-compose up -d
|
@ -43,29 +43,16 @@ print(f"Serwer: {db_server.data_model.name}\n\tpubliczne IP: {db_server.data_mod
|
||||
|
||||
|
||||
|
||||
volume_name = f"{PREFIX}-gitea-vol"
|
||||
|
||||
volume = client.volumes.create(
|
||||
name=volume_name,
|
||||
size=10,
|
||||
format='ext4',
|
||||
location=Location("hel1")
|
||||
)
|
||||
print(f"Created data volume: {volume.volume.name}")
|
||||
|
||||
|
||||
with open("gitea_cloud_init.yml", 'r', encoding='utf-8') as file:
|
||||
cloud_init_wp1 = file.read()
|
||||
|
||||
cloud_init_wp1.replace("VOLUME_NAME", volume_name)
|
||||
|
||||
wp1_server = client.servers.create(
|
||||
name=f"{PREFIX}-gitea",
|
||||
server_type=ServerType("cpx11"),
|
||||
image=Image(name="ubuntu-22.04"),
|
||||
ssh_keys=[ssh_key],
|
||||
networks=[vnet],
|
||||
volumes=[volume.volume],
|
||||
location=Location("hel1"),
|
||||
user_data=cloud_init_wp1
|
||||
)
|
||||
|
Loading…
Reference in New Issue
Block a user