Skip to content

Instantly share code, notes, and snippets.

@michaelbunch
Created October 11, 2018 19:02
Show Gist options
  • Save michaelbunch/db2236cf65faaab404dfd01d680a2309 to your computer and use it in GitHub Desktop.
Save michaelbunch/db2236cf65faaab404dfd01d680a2309 to your computer and use it in GitHub Desktop.
Docker system services
# -----------------------------------------------------------------------------
# Run various servers so they can be locally accessible to the host computer.
# Since the ports used below are default to their respective services you
# could have conflicts with other local instances.
# -----------------------------------------------------------------------------
version: '3.4'
x-defaults: &defaults
restart: unless-stopped
networks:
- systools
services:
mysql:
<<: *defaults
image: mysql:5.7
container_name: mysql
ports:
- 3306:3306
environment:
- MYSQL_ROOT_PASSWORD=secret
volumes:
- mysql-data:/var/lib/mysql
redis:
<<: *defaults
image: redis:4.0-alpine
container_name: redis
ports:
- 6379:6379
volumes:
- redis-data:/data
volumes:
mysql-data:
redis-data:
networks:
systools:
driver: bridge
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment