-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
84 lines (80 loc) · 2.27 KB
/
Copy pathdocker-compose.yml
File metadata and controls
84 lines (80 loc) · 2.27 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
# Container setup for local development and demos.
#
# cp .env.example .env
# # put a 32-byte hex value in APP_KEY, then:
# docker compose up -d
# open http://localhost:8080
#
# The web root is the `public` directory, and the database schema is applied by
# the `migrate` service before the application starts.
services:
db:
image: mariadb:11
environment:
MARIADB_ROOT_PASSWORD: root
MARIADB_DATABASE: inspiration
MARIADB_USER: inspiration
MARIADB_PASSWORD: inspiration
volumes:
- db-data:/var/lib/mysql
healthcheck:
# The application must not start before the database accepts connections.
test: ['CMD', 'healthcheck.sh', '--connect', '--innodb_initialized']
interval: 5s
timeout: 5s
retries: 20
ports:
- '3307:3306'
# Applies migrations and seeds demo data, then exits. `app` waits for it.
migrate:
build:
context: .
dockerfile: docker/php.Dockerfile
depends_on:
db:
condition: service_healthy
environment:
DB_DRIVER: mysql
DB_HOST: db
DB_PORT: 3306
DB_DATABASE: inspiration
DB_USERNAME: inspiration
DB_PASSWORD: inspiration
APP_KEY: ${APP_KEY:-0123456789abcdef0123456789abcdef}
command: sh -c "php bin/migrate.php && php bin/seed.php"
volumes:
- .:/app
restart: 'no'
app:
build:
context: .
dockerfile: docker/php.Dockerfile
depends_on:
db:
condition: service_healthy
migrate:
condition: service_completed_successfully
environment:
APP_ENV: local
APP_DEBUG: 'true'
APP_URL: http://localhost:8080
APP_KEY: ${APP_KEY:-0123456789abcdef0123456789abcdef}
DB_DRIVER: mysql
DB_HOST: db
DB_PORT: 3306
DB_DATABASE: inspiration
DB_USERNAME: inspiration
DB_PASSWORD: inspiration
SESSION_COOKIE_SECURE: 'false'
volumes:
- .:/app
# Uploads live outside the source tree so a rebuild does not discard them.
- uploads:/app/storage/uploads
ports:
- '8080:8080'
# PHP's built-in server keeps the image small and needs no web server config.
# It is single-threaded, which is fine for development and demos.
command: php -S 0.0.0.0:8080 -t public
volumes:
db-data:
uploads: