-
Notifications
You must be signed in to change notification settings - Fork 1
/
docker-compose.override.yaml
97 lines (87 loc) · 2.54 KB
/
docker-compose.override.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
---
# Override file for local testing with config from the default env var
version: "3.8"
services:
ecs-local-endpoints:
image: amazon/amazon-ecs-local-container-endpoints:latest-amd64
volumes:
- /var/run:/var/run
- $HOME/.aws/:/home/.aws/
environment:
ECS_LOCAL_METADATA_PORT: "51679"
HOME: "/home"
AWS_DEFAULT_REGION: ${AWS_DEFAULT_REGION:-eu-west-1}
AWS_PROFILE: ${AWS_PROFILE:-default}
ports:
- 51679:51679
container_name: ecs-local-endpoints
files-sidecar:
container_name: files-sidecar
environment:
AWS_CONTAINER_CREDENTIALS_RELATIVE_URI: "/creds"
ECS_CONTAINER_METADATA_URI: http://169.254.170.2/v3/containers/files-sidecar
AWS_DEFAULT_REGION: ${AWS_DEFAULT_REGION:-eu-west-1}
context: plain
LOGLEVEL: debug
ECS_CONFIG_CONTENT: |
files:
/opt/files/test.txt:
content: >-
test from a yaml raw content
owner: john
group: root
mode: 600
/opt/files/aws.template:
ignore_failure: true
source:
S3:
BucketName: ${BUCKET_NAME:-sacrificial-lamb}
Key: aws.yml
/opt/files/ssm.txt:
source:
Ssm:
ParameterName: /cicd/shared/kms/arn
/opt/files/secret.txt:
source:
Secret:
SecretId: GHToken
/opt/files/test_ecs_property.txt:
content: |
{{ ecs_container_metadata('PrivateDNSName') }}
context: jinja2
/opt/files/test_ecs_properties.yaml:
content: |
{{ ecs_container_metadata() | to_yaml | safe }}
context: jinja2
/opt/files/test_ecs_properties.json:
content: |
{{ ecs_task_metadata() | to_json | safe }}
# HELLO
{{ ecs_container_metadata('ImageID')}}
context: jinja2
ignore_if_failed: true
commands:
post:
- ls /opt/files
- cat /opt/files/test_ecs_properties.json
- chown 1000:1000 -R /opt/files
depends_on:
- ecs-local-endpoints
confirm:
image: public.ecr.aws/amazonlinux/amazonlinux:2
container_name: testing
volumes:
- localshared:/opt/
command:
- ls
- -l
- /opt
depends_on:
- files-sidecar
volumes:
localshared:
driver: local
driver_opts:
device: /tmp/files
o: bind
type: none