File tree Expand file tree Collapse file tree 2 files changed +11
-3
lines changed
template_generators/docker Expand file tree Collapse file tree 2 files changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -44,7 +44,7 @@ services:
4444 environment :
4545 additionalProp1 : string
4646 additionalProp2 : string
47- additionalProp3 : string
47+ additionalProp3 : shhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh
4848 image : string
4949 networks :
5050 - string
Original file line number Diff line number Diff line change 11import yaml
22from app .models .compose_models import DockerCompose
3+ import os
34
45def docker_compose_generator (input ):
5-
6+ dir = 'app/media/MyCompose'
67 compose_total = input .model_dump (mode = "json" )
7-
8+ if not os .path .exists (dir ):
9+ os .makedirs (dir )
10+ os .path .join (dir , 'docker-compose.yaml' )
11+
12+ file = open ("app/media/MyCompose/docker-compose.yaml" ,"w" )
13+ yaml .dump (compose_total ,file )
14+ file .close ()
15+
816 file = open ("app/media/MyCompose/docker-compose.yaml" ,"w" )
917 yaml .dump (compose_total ,file )
1018 file .close ()
You can’t perform that action at this time.
0 commit comments