Last active
April 22, 2022 22:37
-
-
Save vs0uz4/7bd6c3b8ee45ca574aa93534d02edea8 to your computer and use it in GitHub Desktop.
docker-compose Sample
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.5' | |
services: | |
memcached: | |
image: 'memcached:alpine' | |
networks: | |
- yooble | |
redis: | |
image: 'redis:5.0-alpine' | |
volumes: | |
- 'redis-data:/data' # Persist Redis data "/data" on volume "redis-data". | |
ports: | |
- 6379:6379 | |
networks: | |
- yooble | |
healthcheck: | |
test: ["CMD", "redis-cli", "ping"] | |
retries: 3 | |
timeout: 5s | |
mariadb: | |
image: 'mariadb:10.6' | |
volumes: | |
- 'mariadb-data:/var/lib/mysql' # Persist "/var/lib/mysql" on volume "mysql-data". | |
environment: | |
- MYSQL_ROOT_PASSWORD=yoble | |
- MYSQL_DATABASE=yoble | |
- MYSQL_USER=yoble | |
- MYSQL_PASSWORD=yoble | |
ports: | |
- '39003:3306' | |
networks: | |
- yooble | |
healthcheck: | |
test: ["CMD", "mysqladmin", "ping", "-pyoble"] | |
retries: 3 | |
timeout: 5s | |
php: | |
image: php81 | |
build: ./ | |
volumes: | |
- '.:/app' | |
networks: | |
- yooble | |
webserver: | |
image: 'nginx:alpine' | |
volumes: | |
- '.:/app' | |
- './nginx.conf:/etc/nginx/conf.d/default.conf' | |
ports: | |
- '39000:80' | |
depends_on: | |
- memcached | |
- mariadb | |
- redis | |
- php | |
networks: | |
- yooble | |
healthcheck: | |
test: ["CMD", "curl", "--fail", "http://localhost"] | |
retries: 3 | |
timeout: 5s | |
networks: | |
yooble: | |
driver: bridge | |
volumes: | |
mariadb-data: # Persist MariaDB Data. | |
driver: local | |
redis-data: # Persist Redis Data. | |
driver: local |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment