Last active
February 24, 2021 13:21
-
-
Save sparrow/0d4e921bbf57d4b8ac34d112637cae54 to your computer and use it in GitHub Desktop.
This is a code snippet that we used for our blog post https://rubygarage.org/blog/advantages-of-using-docker-for-microservices at RubyGarage. The code shows a Docker Compose file that create three services.
This file contains 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.9' | |
services: | |
nginx: | |
build: ./nginx | |
restart: always | |
depends_on: | |
- wordpress | |
volumes: | |
- demo-wordpress:/var/www/html | |
ports: | |
- 80:80 | |
wordpress: | |
image: wordpress:php7.1-fpm | |
environment: | |
WORDPRESS_DB_HOST: mysql | |
WORDPRESS_DB_PASSWORD: example | |
depends_on: | |
- mysql | |
volumes: | |
- demo-wordpress:/var/www/html | |
mysql: | |
image: mariadb | |
environment: | |
MYSQL_ROOT_PASSWORD: example | |
volumes: | |
- demo-db:/var/lib/mysql | |
volumes: | |
demo-db: | |
demo-wordpress: |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment