You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: README.md
+19-10
Original file line number
Diff line number
Diff line change
@@ -75,31 +75,31 @@ For an application repository to leverage the full power of the dev-env...
75
75
76
76
Docker containers are used to run all apps. So some files are needed to support that.
77
77
78
-
##### `/fragments/docker-compose-fragment.yml`
78
+
##### `/fragments/compose-fragment.yml`
79
79
80
-
This is used by the environment to construct an application container and then launch it. Standard [Compose file](https://docs.docker.com/compose/compose-file/) structure applies - and all apps must use the same Compose file version (which must be 2) - but some recommendations are:
80
+
This is used by the environment to construct an application container and then launch it. Standard [Compose Spec](https://github.com/compose-spec/compose-spec/blob/master/spec.md) structure applies - but some recommendations are:
81
81
82
82
* Container name and service name should match
83
83
* Any ports that need to be accessed from the host machine (as opposed to from other containers) should be mapped
84
84
* A `volumes` entry should map the path of the app folder to wherever the image expects source files to be (if they are to be accessed dynamically, and not copied in at image build time)
85
85
* If the provided log collator is to be used, then a syslog logging driver needs to be present, forwarding to logstash:25826.
86
-
* If you wish to run the container as the host user so you have full access to any files created by the container (this is only a problem on Linux and Windows), environment variables `OUTSIDE_UID` and `OUTSIDE_GID` are provided for use in the fragment as build args (which can then be used in the `Dockerfile` to create a matching user and set them as the container-executor).
86
+
* If you wish to run the container as the host user so you have full access to any files created by the container (this is only a problem on Linux and WSL), environment variables `OUTSIDE_UID` and `OUTSIDE_GID` are provided for use in the fragment as build args (which can then be used in the `Dockerfile` to create a matching user and set them as the container-executor).
87
87
88
-
Although generally an application should only have itself in it's compose fragment, there is no reason why other containers based on other Docker images cannot also be listed in this file, if they are not provided already by the dev-env.
88
+
Although generally an application should only have itself in its compose fragment, there is no reason why other containers based on other Docker images cannot also be listed in this file, if they are not provided already by the dev-env.
89
89
90
90
Note that when including directives such as a Dockerfile build location or host volume mapping for the source code, the Compose context root `.` is considered to be the dev-env's /apps/ folder, not the location of the fragment. Ensure relative paths are set accordingly.
##### `/fragments/docker-compose-fragment.yml` and `/fragments/docker-compose-fragment.3.7.yml`
95
95
96
-
An optional variant of `docker-compose-fragment.yml` with a version of `3.7`. The development environment will select the highest compose file version supplied by all applications in the environment. If all applications supply a `docker-compose-fragment.3.7.yml`, then the environment will use the `3.7` files, otherwise it falls back to the version `2` compose files.
97
-
98
-
Compose 3.7 support requires Docker engine version 18.06.0 or later.
96
+
Optional variants of `compose-fragment.yml` with a version of `2` and `3.7` respectively. Support for these is still present for backwards compatibility with older apps.The development environment will select the highest compose file version supplied by _all_ applications in the environment (2 --> 3.7 --> unversioned).
99
97
100
98
If the environment cannot identify a universal compose file version, then provisioning will fail.
@@ -133,6 +133,7 @@ The list of allowable commodity values is:
133
133
16. cadence-web
134
134
17. activemq
135
135
18. ibmmq
136
+
19. localstack
136
137
137
138
* The file may optionally also indicate that one or more services are resource intensive ("expensive") when starting up. The dev env will start those containers seperately - 3 at a time - and wait until each are declared healthy (or crash and get restarted 10 times) before starting any more. This requires a healthcheck command specified here or in the Dockerfile/docker-compose-fragment (in which case just use 'docker' in this file).
138
139
* If one of these expensive services prefers another one to be considered "healthy" before a startup attempt is made (such as a database, to ensure immediate connectivity and no expensive restarts) then the dependent service can be specified here, with a healthcheck command following the same rules as above.
@@ -304,6 +305,13 @@ cadence core services.
304
305
*Running Cadence web locally*
305
306
- In a web browser enter http://localhost:5004
306
307
308
+
###### Localstack
309
+
[Localstack](https://localstack.cloud) is a cloud stack testing and mocking framework for developing against various AWS services.
310
+
311
+
A default Localstack configuration is provided with a minimal number of enabled services available (S3 only at present). Localstack does not *require* the use of any other external configuration file (as applications can manage buckets programatically through methods such as the [AWS SDK](https://docs.aws.amazon.com/sdk-for-java/v1/developer-guide/examples-s3-buckets.html)). However, if additional configuration (such as new buckets) are necessary before application startup, you can use a `localstack-init-fragment.sh` to perform this provisioning; an example of which is provided [here](snippets/localstack-init-fragment.sh).
312
+
313
+
Localstack is available at <http://localstack:4566> within the Docker network, and <http://localhost:4566> on the host.
314
+
307
315
#### Other files
308
316
309
317
**`/fragments/custom-provision.sh`**
@@ -336,6 +344,7 @@ If you want to make use of this functionality, ensure that `logstash` is also pr
336
344
337
345
* Ensure that you give Docker enough CPU and memory to run all your apps.
338
346
* The `run.sh destroy` command should be a last resort, as you will have to rebuild all images from scratch. Try the `fullreset` alias as that will just remove your app containers and recreate them. They are most likely to be the source of any corruption. Remember to alter `.commodities.yml` and `.custom_provision.yml` if you need to, and `run.sh reload`.
347
+
* A memory limit of 384mb is set for intermediate containers during the image build process - but only if using Docker Compose V1 and you have Buildkit disabled in advanced Docker settings.
Copy file name to clipboardexpand all lines: scripts/add-aliases.sh
+5
Original file line number
Diff line number
Diff line change
@@ -88,6 +88,10 @@ function manage(){
88
88
ex ${1} python3 manage.py ${@:2}
89
89
}
90
90
91
+
functionlocalstack(){
92
+
ex localstack awslocal ${@:1}
93
+
}
94
+
91
95
functionfullreset(){
92
96
stop ${1}
93
97
remove ${1}
@@ -146,5 +150,6 @@ function devenv-help(){
146
150
add-to-docker-compose
147
151
<name of new compose fragment> - looks in fragments folder of loaded apps to search for a new docker-compose-fragment including the provided parameter eg docker-compose-syt2-fragment then runs docker-compose up
148
152
cadence-cli - runs the command line tool to interact with cadence orchestrator
153
+
localstack - run localstack (aws) commands in the localstack container
0 commit comments