Compare commits
No commits in common. "4a5268780a0a875f1370e39d3a233073bcd61d00" and "440e9291b313ca3ea6a2a738c14f75485b4b70d0" have entirely different histories.
4a5268780a
...
440e9291b3
@ -30,8 +30,7 @@ write_files:
|
|||||||
restart: always
|
restart: always
|
||||||
|
|
||||||
volumes:
|
volumes:
|
||||||
- /mnt/VOLUME_NAME/data:/var/lib/gitea
|
- ./gitea:/data
|
||||||
- /mnt/VOLUME_NAME/config:/etc/gitea
|
|
||||||
- /etc/timezone:/etc/timezone:ro
|
- /etc/timezone:/etc/timezone:ro
|
||||||
- /etc/localtime:/etc/localtime:ro
|
- /etc/localtime:/etc/localtime:ro
|
||||||
|
|
||||||
@ -48,11 +47,4 @@ runcmd:
|
|||||||
- chmod +x /usr/local/bin/docker-compose
|
- chmod +x /usr/local/bin/docker-compose
|
||||||
- systemctl start docker
|
- systemctl start docker
|
||||||
- systemctl enable 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
|
- 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:
|
with open("gitea_cloud_init.yml", 'r', encoding='utf-8') as file:
|
||||||
cloud_init_wp1 = file.read()
|
cloud_init_wp1 = file.read()
|
||||||
|
|
||||||
cloud_init_wp1.replace("VOLUME_NAME", volume_name)
|
|
||||||
|
|
||||||
wp1_server = client.servers.create(
|
wp1_server = client.servers.create(
|
||||||
name=f"{PREFIX}-gitea",
|
name=f"{PREFIX}-gitea",
|
||||||
server_type=ServerType("cpx11"),
|
server_type=ServerType("cpx11"),
|
||||||
image=Image(name="ubuntu-22.04"),
|
image=Image(name="ubuntu-22.04"),
|
||||||
ssh_keys=[ssh_key],
|
ssh_keys=[ssh_key],
|
||||||
networks=[vnet],
|
networks=[vnet],
|
||||||
volumes=[volume.volume],
|
|
||||||
location=Location("hel1"),
|
location=Location("hel1"),
|
||||||
user_data=cloud_init_wp1
|
user_data=cloud_init_wp1
|
||||||
)
|
)
|
||||||
|
Loading…
Reference in New Issue
Block a user