Skip to content

Instantly share code, notes, and snippets.

@mizner
Forked from RafPe/docker_composeV2_static.yml
Last active August 24, 2016 15:14
Show Gist options
  • Save mizner/56a9581278f2317e18cb1ddcb36793d6 to your computer and use it in GitHub Desktop.
Save mizner/56a9581278f2317e18cb1ddcb36793d6 to your computer and use it in GitHub Desktop.
Docker compose V2 static addressing (example?)
services:
haproxy:
image: haproxy:latest
ports:
- "80:80"
- "443:443"
volumes:
- ${PWD}/haproxy/haproxy.cfg:/usr/local/etc/haproxy/haproxy.cfg
restart: always
networks:
- widgets
logging:
driver: json-file
options:
max-size: "100m"
max-file: "3"
labels: "haproxy"
mariadb:
image: mariadb:latest
volumes:
- /vol/appdata/mariadb:/var/lib/mysql
environment:
- MYSQL_ROOT_PASSWORD=secret-pw
restart: always
networks:
- widgets
logging:
driver: json-file
options:
max-size: "100m"
max-file: "3"
labels: "mariadb"
app_orangella:
image: apache:1.0
restart: always
ports:
- "81:80"
networks:
- widgets
logging:
driver: json-file
options:
max-size: "50m"
max-file: "3"
labels: "app_orangella"
networks:
widgets:
driver: bridge
ipam:
config:
- subnet: 172.10.0.0/16
gateway: 172.10.5.254
aux_addresses:
haproxy: 172.10.1.2
mariadb: 172.10.1.3
app_orangella: 172.10.1.4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment