Add Docker and Docker Compose
This commit is contained in:
parent
ebd57a2e69
commit
29d88893fa
11 changed files with 162 additions and 1 deletions
69
docker-compose.yaml
Normal file
69
docker-compose.yaml
Normal file
|
@ -0,0 +1,69 @@
|
|||
version: '2.4'
|
||||
|
||||
volumes:
|
||||
mysql_data:
|
||||
|
||||
networks:
|
||||
web:
|
||||
external:
|
||||
name: traefik_proxy
|
||||
|
||||
services:
|
||||
nginx:
|
||||
image: nginx:1-alpine
|
||||
working_dir: /app
|
||||
volumes:
|
||||
- ./:/app
|
||||
- ./tools/docker/images/nginx/configs/vhost.conf:/etc/nginx/conf.d/default.conf
|
||||
depends_on:
|
||||
node:
|
||||
condition: service_started
|
||||
php:
|
||||
condition: service_started
|
||||
networks:
|
||||
default: {}
|
||||
web: {}
|
||||
labels:
|
||||
- traefik.docker.network=traefik_proxy
|
||||
- traefik.enable=true
|
||||
- traefik.http.routers.oliverdavies.rule=Host(`oliverdavies.docker.localhost`)
|
||||
|
||||
php:
|
||||
build:
|
||||
context: .
|
||||
dockerfile: tools/docker/Dockerfile
|
||||
target: dev
|
||||
volumes:
|
||||
- ./:/app
|
||||
env_file:
|
||||
- .docker.env
|
||||
depends_on:
|
||||
mysql:
|
||||
condition: service_healthy
|
||||
networks:
|
||||
default: {}
|
||||
labels:
|
||||
- "traefik.enable=false"
|
||||
|
||||
mysql:
|
||||
image: mariadb:10
|
||||
volumes:
|
||||
- mysql_data:/var/lib/mysql
|
||||
- ./tools/docker/images/mysql/databases.sql:/docker-entrypoint-initdb.d/databases.sql
|
||||
env_file:
|
||||
- .docker.env
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", "bash", "-c", "echo > /dev/tcp/localhost/3306"]
|
||||
interval: 1s
|
||||
networks:
|
||||
default: {}
|
||||
labels:
|
||||
- "traefik.enable=false"
|
||||
|
||||
node:
|
||||
image: node:12
|
||||
working_dir: /node
|
||||
volumes:
|
||||
- ./web:/node
|
||||
labels:
|
||||
- "traefik.enabled=false"
|
Loading…
Add table
Add a link
Reference in a new issue