Skip to content

Commit c61adb3

Browse files
committed
fix(compose): directory builder
1 parent 67e63bb commit c61adb3

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

app/media/MyCompose/docker-compose.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff 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

app/template_generators/docker/compose.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,18 @@
11
import yaml
22
from app.models.compose_models import DockerCompose
3+
import os
34

45
def 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()

0 commit comments

Comments
 (0)