|
|
|
## Dependencies
|
|
|
|
|
|
|
|
The [Dockerfile](ironapi-gw/Dockerfile) in the main repo is based on a docker image built
|
|
|
|
with [Dockerfile_Deps](ironapi-gw/Dockerfile_Deps).
|
|
|
|
|
|
|
|
```
|
|
|
|
~/ironapi/ironapi-gw/etc[master]$ docker build -t ironapi/ironapi-gw-deps .
|
|
|
|
|
|
|
|
```
|
|
|
|
## Copy vs Mount
|
|
|
|
|
|
|
|
When the main docker image is built,
|
|
|
|
|
|
|
|
```
|
|
|
|
~/ironapi/ironapi-gw[master]$ docker build -t ironapi/ironapi-gw .
|
|
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
it takes a copy of the current directory to be mounted in /app on startup.
|
|
|
|
|
|
|
|
```
|
|
|
|
docker run -t -p 3000:3000 --name ironapigw
|
|
|
|
```
|
|
|
|
|
|
|
|
Beware: any code changes after building the image will not be available when you run the image! So, `db.conf` needs to be written before building the image, or the current directory can be mounted (this overrides the copy directive in the Dockerfile):
|
|
|
|
|
|
|
|
```
|
|
|
|
docker run -t -p 3000:3000 --name ironapigw --mount type=bind,source="$(pwd)",target=/app ironapi-gw
|
|
|
|
```
|
|
|
|
|
|
|
|
## Logging
|
|
|
|
|
|
|
|
Docker redirects anything written to STDOUT or STDERR to the configured log driver. To change it from the default "json-file" to syslog, either configure it for the entire host system:
|
|
|
|
|
|
|
|
```
|
|
|
|
root@ninne:/etc/docker# more daemon.json
|
|
|
|
{
|
|
|
|
"log-driver" : "syslog"
|
|
|
|
}
|
|
|
|
|
|
|
|
```
|
|
|
|
or set it a run time:
|
|
|
|
|
|
|
|
`docker run -t --log-driver syslog`
|
|
|
|
|
|
|
|
Them messages end up in the syslog `tail -f /var/log/syslog`
|
|
|
|
|
|
|
|
All scripts use the same [[logging configuration|Logging]], which currently sends everything to STDOUT as well as a log file. Note the -t option - it allocates a pseudo-TTY, which also gets us the catalyst access log on STDERR. |
|
|
\ No newline at end of file |