[Python-de] ports mit Doppelpunkt nach docker-compose schreiben
Lars Liedtke
liedtke at punkt.de
Do Okt 22 12:31:31 EDT 2020
Hey,
ich finde
docker_compose["services"]["app"]["ports"] = [f"{str(ext_port)}:80"]
schöner, das ist aber rein persönliches Empfinden. Aber vielleicht hilft
Dir das trotzdem. Schau mal nach f-strings.
Viele Grüße
Lars
Am 22.10.20 um 18:28 schrieb Stefan Fuhrmann:
> Ahoi,
>
>
> habs tatsächlich gefunden:
>
> docker_compose["services"]["app"]["ports"] = [str(ext_port) +str(":80")]
>
>
> Am 22.10.20 um 15:12 schrieb Stefan Fuhrmann:
>> Hallo zusammen,
>>
>>
>> ich habe ein script, das mir nextcloud ausrollt und möchte es nun
>> erweitern, dass es auf ports prüft und entsprechend einen port
>> hochzählt und in die docker-compose schreibt.
>>
>> Im compose file wird es mit 8080:80 angegeben.
>>
>>
>> Ich habe es soweit , das es mir den port hochzählt und schreibt. Mir
>> gelingt es aber nicht :80 hinzuzufügen.
>>
>> Ich habe eine funktion "next_free_port" hinten soll :80 hinzu.
>>
>> docker_compose["services"]["app"]["ports"] = [next_free_port() +":80"]
>>
>>
>> Ich habe versucht und gesucht. Es will mir aber nicht gelingen.
>>
>> Kann jemand helfen?
>>
>>
>> Danke!
>>
>> Gruß
>>
>> Stefan
>>
>>
>>
>>
>>
>>
>>
>> _______________________________________________
>> python-de maillist - python-de at python.org
>> https://mail.python.org/mailman/listinfo/python-de
> _______________________________________________
> python-de maillist - python-de at python.org
> https://mail.python.org/mailman/listinfo/python-de
--
---
punkt.de GmbH
Lars Liedtke
.infrastructure
Kaiserallee 13a
76133 Karlsruhe
Tel. +49 721 9109 500
https://infrastructure.punkt.de
info at punkt.de
AG Mannheim 108285
Geschäftsführer: Jürgen Egeling, Daniel Lienert, Fabian Stein
-------------- nächster Teil --------------
Ein Dateianhang mit Binärdaten wurde abgetrennt...
Dateiname : signature.asc
Dateityp : application/pgp-signature
Dateigröße : 899 bytes
Beschreibung: OpenPGP digital signature
URL : <https://mail.python.org/pipermail/python-de/attachments/20201022/a5936d7f/attachment.sig>
Mehr Informationen über die Mailingliste python-de