Skip to content

Instantly share code, notes, and snippets.

@arulrajnet
Created February 20, 2019 09:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save arulrajnet/6cf9ed72d1dd85c61a61f8605d68e37f to your computer and use it in GitHub Desktop.
Save arulrajnet/6cf9ed72d1dd85c61a61f8605d68e37f to your computer and use it in GitHub Desktop.
httpbin using docker-compose with requestlog
GUNICORN_CMD_ARGS=--capture-output --error-logfile - --access-logfile - --access-logformat '%(h)s %(t)s %(r)s %(s)s Host: %({Host}i)s}'
version: '3.7'
# YAML Aliases / Anchors.
x-networkName: &networkName "default"
x-default: &default
# compose 3.4 introtuced x- extended fields for aliasing.
logging:
driver: journald
options:
tag: orchestrator
dns:
- 8.8.8.8
- 9.9.9.9
services:
# HTTPBin service
httpbin:
<<: *default
image: kennethreitz/httpbin:latest
networks:
*networkName:
aliases:
- httpbin
ports:
- 80:80
environment:
- GUNICORN_CMD_ARGS=${GUNICORN_CMD_ARGS}
networks:
*networkName:
driver: bridge
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment