Skip to content

Commit 4c00ffe

Browse files
chore: moving default service settings from compose file into code
1 parent 4b41b4f commit 4c00ffe

File tree

2 files changed

+4
-26
lines changed

2 files changed

+4
-26
lines changed

docker-compose.yml

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,6 @@
11
version: "3"
22

33
services:
4-
_:
5-
&default
6-
image: alpine
7-
stop_grace_period: 1s
8-
tty: true
9-
stdin_open: true
104
_compile:
115
image: golang
126
entrypoint: go
@@ -18,7 +12,6 @@ services:
1812
- "dockerized_compile:/go/pkg"
1913
alpine:
2014
&alpine
21-
<<: *default
2215
image: "alpine_${ALPINE_VERSION}"
2316
build:
2417
context: apps/alpine
@@ -34,15 +27,13 @@ services:
3427
ALPINE_PACKAGES: "apache2-ssl apache2-utils ca-certificates"
3528
entrypoint: [ "ab" ]
3629
aws:
37-
<<: *default
3830
image: "amazon/aws-cli:${AWS_VERSION}"
3931
volumes:
4032
- "${HOME:-}/.aws:/root/.aws"
4133
environment:
4234
AWS_ACCESS_KEY_ID: "${AWS_ACCESS_KEY_ID:-}"
4335
AWS_SECRET_ACCESS_KEY: "${AWS_SECRET_ACCESS_KEY:-}"
4436
bash:
45-
<<: *default
4637
image: "bash"
4738
build:
4839
context: apps/alpine
@@ -51,7 +42,6 @@ services:
5142
ALPINE_PACKAGES: "bash"
5243
entrypoint: ["/bin/bash"]
5344
doctl:
54-
<<: *default
5545
image: "doctl:${DOCTL_VERSION}"
5646
build:
5747
context: apps/doctl
@@ -63,11 +53,9 @@ services:
6353
volumes:
6454
- "${HOME:-}/.dockerized/apps/doctl:/root"
6555
dotnet:
66-
<<: *default
6756
image: "mcr.microsoft.com/dotnet/sdk:${DOTNET_VERSION}-alpine"
6857
entrypoint: [ "dotnet" ]
6958
gh:
70-
<<: *default
7159
image: "gh:${GH_VERSION}"
7260
build:
7361
context: apps/gh
@@ -83,26 +71,20 @@ services:
8371
environment:
8472
BROWSER: "echo"
8573
git:
86-
<<: *default
8774
image: "alpine/git:v${GIT_VERSION}"
8875
entrypoint: [ "git" ]
8976
go:
90-
<<: *default
9177
image: "golang:${GO_VERSION}"
9278
entrypoint: [ "go" ]
9379
helm:
94-
<<: *default
9580
image: "alpine/helm:${HELM_VERSION}"
9681
http:
97-
<<: *default
9882
image: "alpine/httpie:${HTTPIE_VERSION}"
9983
entrypoint: [ "http" ]
10084
jq:
101-
<<: *default
10285
image: stedolan/jq
10386
node:
10487
&node
105-
<<: *default
10688
image: "node:${NODE_VERSION}"
10789
entrypoint: [ "node" ]
10890
volumes:
@@ -115,10 +97,8 @@ services:
11597
<<: *node
11698
entrypoint: [ "npx" ]
11799
php:
118-
<<: *default
119100
image: "php:${PHP_VERSION}"
120101
protoc:
121-
<<: *default
122102
image: "protoc:${PROTOC_VERSION}"
123103
build:
124104
context: apps/protoc
@@ -128,24 +108,20 @@ services:
128108
PROTOC_ARCH: "${PROTOC_ARCH}"
129109
python:
130110
&python
131-
<<: *default
132111
image: "python:${PYTHON_VERSION}"
133112
entrypoint: [ "python" ]
134113
volumes:
135114
- "python_modules:/usr/local/lib/python${PYTHON_VERSION}/site-packages"
136115
- "${HOME:-}/.dockerized/apps/python:/root"
137116
python2:
138-
<<: *default
139117
image: "python:${PYTHON2_VERSION}"
140118
pip:
141119
<<: *python
142120
entrypoint: [ "pip" ]
143121
ruby:
144-
<<: *default
145122
image: "ruby:${RUBY_VERSION}"
146123
entrypoint: [ "ruby" ]
147124
s3cmd:
148-
<<: *default
149125
build:
150126
context: apps/s3cmd
151127
args:
@@ -158,7 +134,6 @@ services:
158134
volumes:
159135
- "${HOME:-}/.dockerized/apps/s3cmd:/root"
160136
swagger-codegen:
161-
<<: *default
162137
image: "swaggerapi/swagger-codegen-cli-v3:${SWAGGER_CODEGEN_VERSION}"
163138
tree:
164139
<<: *alpine
@@ -170,7 +145,6 @@ services:
170145
<<: *node
171146
entrypoint: [ "npx", "--package=@vue/cli@${VUE_VERSION}", "vue" ]
172147
wget:
173-
<<: *default
174148
image: "${DEFAULT_BASE}"
175149
entrypoint: [ "wget" ]
176150
yarn:

lib/dockerized.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -360,7 +360,11 @@ func dockerComposeRun(project *types.Project, runOptions api.RunOptions, volumes
360360
if service.CustomLabels == nil {
361361
service.CustomLabels = map[string]string{}
362362
}
363+
364+
stopGracePeriod := types.Duration(1)
363365
service.Volumes = append(service.Volumes, volumes...)
366+
service.StopGracePeriod = &stopGracePeriod
367+
service.StdinOpen = true
364368

365369
backend, err := getBackend()
366370
if err != nil {

0 commit comments

Comments
 (0)