Skip to content

Commit 85fe299

Browse files
committed
Add env variable
1 parent 3b8457a commit 85fe299

3 files changed

Lines changed: 11 additions & 0 deletions

File tree

.env.template

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# see https://docs.docker.com/compose/environment-variables/variable-interpolation/
2+
# see https://docs.docker.com/reference/cli/docker/container/run/#env
3+
APP_GREETING='Greeting from .env'

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,12 @@ docker stop helidon-se
102102
docker compose run -d --name helidon-se --rm helidon-se
103103
```
104104

105+
Use ```./.env``` file or overwrite as
106+
107+
```shell
108+
APP_GREETING=Greet docker compose up -d
109+
```
110+
105111
and follow ```-f``` logs
106112

107113
```shell

docker-compose.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ services:
22
helidon-se:
33
container_name: helidon-se
44
image: a002k/helidon-se:latest
5+
environment:
6+
- APP_GREETING=${APP_GREETING:-'Greeting from docker-compose'}
57
ports:
68
- "8080:8080"
79
networks:

0 commit comments

Comments
 (0)