@@ -601,7 +601,8 @@ services:
601601 soft: $theint
602602 privileged: $thebool
603603 read_only: $thebool
604- shm_size: 2gb
604+ shm_size: ${thesize}
605+ stop_grace_period: ${theduration}
605606 stdin_open: ${thebool}
606607 tty: $thebool
607608 volumes:
@@ -628,9 +629,11 @@ networks:
628629 back:
629630`
630631 env := map [string ]string {
631- "theint" : "555" ,
632- "thefloat" : "3.14" ,
633- "thebool" : "true" ,
632+ "theint" : "555" ,
633+ "thefloat" : "3.14" ,
634+ "thebool" : "true" ,
635+ "theduration" : "60s" ,
636+ "thesize" : "2gb" ,
634637 }
635638
636639 config , err := Load (buildConfigDetails (dict , env ), func (options * Options ) {
@@ -641,9 +644,12 @@ networks:
641644
642645 workingDir , err := os .Getwd ()
643646 assert .NilError (t , err )
647+ duration , err := time .ParseDuration ("60s" )
648+ assert .NilError (t , err )
649+ typesDuration := types .Duration (duration )
644650 expected := & types.Project {
645651 Name : "" ,
646- Environment : map [ string ] string { "thebool" : "true" , "thefloat" : "3.14" , "theint" : "555" } ,
652+ Environment : env ,
647653 WorkingDir : workingDir ,
648654 Services : []types.ServiceConfig {
649655 {
@@ -690,12 +696,13 @@ networks:
690696 "nproc" : {Single : 555 },
691697 "nofile" : {Hard : 555 , Soft : 555 },
692698 },
693- Privileged : true ,
694- ReadOnly : true ,
695- Scale : 1 ,
696- ShmSize : types .UnitBytes (2 * 1024 * 1024 * 1024 ),
697- StdinOpen : true ,
698- Tty : true ,
699+ Privileged : true ,
700+ ReadOnly : true ,
701+ Scale : 1 ,
702+ ShmSize : types .UnitBytes (2 * 1024 * 1024 * 1024 ),
703+ StopGracePeriod : & typesDuration ,
704+ StdinOpen : true ,
705+ Tty : true ,
699706 Volumes : []types.ServiceVolumeConfig {
700707 {
701708 Source : "data" ,
0 commit comments