Add project files
This commit is contained in:
50
php-compose-project/docker-compose.yml
Normal file
50
php-compose-project/docker-compose.yml
Normal file
@@ -0,0 +1,50 @@
|
||||
version: '3'
|
||||
|
||||
services:
|
||||
nginx:
|
||||
image: nginx:alpine
|
||||
ports:
|
||||
- "8000:80"
|
||||
volumes:
|
||||
- ./src:/var/www/html
|
||||
- ./docker/nginx/default.conf:/etc/nginx/conf.d/default.conf
|
||||
depends_on:
|
||||
- php
|
||||
networks:
|
||||
- frontend
|
||||
- backend
|
||||
|
||||
php:
|
||||
build:
|
||||
context: ./docker/php
|
||||
dockerfile: Dockerfile
|
||||
volumes:
|
||||
- ./src:/var/www/html
|
||||
environment:
|
||||
- DB_HOST=db
|
||||
- DB_USER=root
|
||||
- DB_PASS=secret
|
||||
- DB_NAME=testdb
|
||||
networks:
|
||||
- backend
|
||||
depends_on:
|
||||
- db
|
||||
|
||||
db:
|
||||
image: mysql:8.0
|
||||
command: --default-authentication-plugin=mysql_native_password
|
||||
environment:
|
||||
- MYSQL_ROOT_PASSWORD=secret
|
||||
- MYSQL_DATABASE=testdb
|
||||
volumes:
|
||||
- db_data:/var/lib/mysql
|
||||
networks:
|
||||
- backend
|
||||
|
||||
networks:
|
||||
frontend:
|
||||
backend:
|
||||
internal: true
|
||||
|
||||
volumes:
|
||||
db_data:
|
||||
Reference in New Issue
Block a user