Created
March 17, 2019 12:45
-
-
Save musaid/30a88e6889834302f751995f2fe3cb4a to your computer and use it in GitHub Desktop.
Sample Docker Compose File
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: '3' | |
services: | |
proxy: | |
container_name: proxy | |
image: jwilder/nginx-proxy | |
ports: | |
- 80:80 | |
volumes: | |
- /var/run/docker.sock:/tmp/docker.sock:ro | |
networks: | |
dcn: | |
ipv4_address: 10.1.1.10 | |
db: | |
container_name: db | |
image: mysql:5.7 | |
ports: | |
- 33:3306 | |
expose: | |
- 3306 | |
environment: | |
- MYSQL_ROOT_PASSWORD=@d3v | |
- MYSQL_DATABASE=app | |
- MYSQL_USER=dev | |
- MYSQL_PASSWORD=@d3v | |
- VIRTUAL_HOST=db.local | |
extra_hosts: | |
- "app.local:10.1.1.1" | |
volumes: | |
- /var/lib/mysql | |
networks: | |
dcn: | |
ipv4_address: 10.1.1.11 | |
app: | |
container_name: app | |
image: musaid/apache:2.1 | |
ports: | |
- 81:80 | |
environment: | |
- VIRTUAL_HOST=app.local | |
extra_hosts: | |
- "db.local:10.1.1.1" | |
volumes: | |
- ./:/var/www/html | |
links: | |
- db:10.1.1.11 | |
stdin_open: true | |
networks: | |
dcn: | |
ipv4_address: 10.1.1.12 | |
networks: | |
dcn: | |
driver: bridge | |
ipam: | |
config: | |
- subnet: 10.1.1.0/24 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment