Files
archived-web-master/docker-compose.yml
Niklas Keller bcb226b644 Add docker development setup (#10)
* Add docker development setup

* Centralize DB credentials

* Remove symlink in favor of separate static file serving

* Update generated composer files
2021-04-11 21:56:50 +02:00

46 lines
1.1 KiB
YAML

version: '3'
services:
db:
image: mysql:8.0.23
volumes:
- db_data:/var/lib/mysql
- ${PWD}/schema.sql:/docker-entrypoint-initdb.d/001-schema.sql
- ${PWD}/docker/test.sql:/docker-entrypoint-initdb.d/002-test.sql
restart: always
environment:
MYSQL_RANDOM_ROOT_PASSWORD: '1'
MYSQL_USER: 'php_main'
MYSQL_PASSWORD: 'test_51ebe2993a2568c6fbb1cfb4c4277991'
MYSQL_DATABASE: 'php_main'
web:
depends_on:
- db
image: php-web-main:latest
build:
context: ./docker
restart: always
command: php -S 0.0.0.0:8000 -d include_path="/app/include/" -derror_reporting="E_ALL&~E_DEPRECATED" -t /app/public /app/docker/controller.php
ports:
- "127.0.0.1:8000:8000"
volumes:
- ${PWD}:/app
environment:
DATABASE_HOST: 'db'
DATABASE_USER: 'php_main'
DATABASE_PASSWORD: 'test_51ebe2993a2568c6fbb1cfb4c4277991'
DATABASE_NAME: 'php_main'
static:
image: caddy:2
restart: always
command: caddy file-server --listen :8002 --root /app
ports:
- "127.0.0.1:8002:8002"
volumes:
- ${PWD}/shared:/app
volumes:
db_data: {}