-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
executable file
·80 lines (75 loc) · 1.84 KB
/
docker-compose.yml
File metadata and controls
executable file
·80 lines (75 loc) · 1.84 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
version: '3'
services:
db:
container_name: mysql
image: mysql:8.0
environment:
MYSQL_DATABASE: my_app
MYSQL_USER: app_user
MYSQL_PASSWORD: secret-pw
MYSQL_ROOT_PASSWORD: secret-pw
restart: on-failure
user: mysql
ports:
- "3306:3306"
volumes:
- db-data:/var/lib/mysql
networks:
- db_network
healthcheck:
test: mysqladmin -u root -p'$$MYSQL_ROOT_PASSWORD' ping -h localhost
interval: 1s
timeout: 40s
retries: 30
start_period: 5s
# Se preferir usar Postgres, tudo que terá que fazer é remover o
# bloco de definição do MySQL e descomentar este aqui:
# db:
# container_name: postgres
# image: postgres:13.3-alpine
# environment:
# POSTGRES_DB: my_app
# POSTGRES_USER: app_user
# POSTGRES_PASSWORD: secret-pw
# restart: on-failure
# user: postgres
# ports:
# - "5432:5432"
# volumes:
# - db-data:/var/lib/mysql
# networks:
# - db_network
# healthcheck:
# test: pg_isready -U postgres
# interval: 1s
# timeout: 15s
# retries: 20
php:
container_name: php
image: fabiojanio/php:8.4-cli-alpine3.22
volumes:
- /your/project/here:/app
#- ./config/php.ini:/usr/local/etc/php
working_dir: /app
restart: on-failure
user: www-data
ports:
- "8080:80"
depends_on:
db:
condition: service_healthy
networks:
- db_network
command: >
sh -c "php artisan migrate
&& php artisan serve --host=0.0.0.0 --port=80"
# Veja outro exemplo, só que desta vez rodando as migrations e o servidor
# web embutido do Yii Framework:
# command: >
# sh -c "php yii migrate/up --interactive 0
# && php yii serve 0.0.0.0:80"
volumes:
db-data:
networks:
db_network:
driver: bridge