-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.example.yml
86 lines (78 loc) · 1.95 KB
/
docker-compose.example.yml
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
85
86
version: '3'
services:
# The NGINX web/reverse-proxy server.
nginx-proxy:
restart: always
depends_on:
- app
networks:
- laratt-network
image: nginx:latest
ports:
- 9088:80
volumes:
- "./.docker/conf/site.conf:/etc/nginx/conf.d/default.conf"
- "./public:/var/www/public:ro"
# Remove the comment below to enable nginx logs.
#- "./logs/:/var/log/nginx/"
# The Laravel app.
app:
restart: always
depends_on:
- dbhost
networks:
- laratt-network
image: laradock/php-fpm:2.2-7.2
volumes:
- "./:/var/www"
# The database server.
dbhost:
restart: always
image: mariadb:10.2
networks:
- laratt-network
hostname: dbhost
command: ["mysqld", "--innodb-buffer-pool-size=1G"]
environment:
- "MYSQL_ROOT_PASSWORD=secret"
- "MYSQL_DATABASE=laratt"
- "MYSQL_USER=homestead"
- "MYSQL_PASSWORD=secret"
volumes:
- "./.docker/conf/my.cnf:/etc/mysql/my.cnf:ro"
- "./.docker/data/mysql:/var/lib/mysql:rw"
# The reason you want to physically mount /var/lib/mysql
# because I don't trust docker. There are instances
# when docker can become unresponsive and the only
# way to get it back is to start from scratch
# by deleting rm -rf /var/lib/docker/*
#
# Using docker volume means you will loose your data
# but redis is fine if we're just using it like
# memcache.
# The redis caching server.
# redis:
# image: redis:4-alpine
# restart: always
# hostname: redis
# command: ["redis-server", "--appendonly", "yes"]
# networks:
# - laratt-network
# volumes:
# - redis-data:/data
# (Optional) A PHPMyAdmin web interface for the database.
# phpmyadmin:
# depends_on:
# - dbhost
# image: phpmyadmin/phpmyadmin
# restart: always
# ports:
# - 8080:80
# environment:
# PMA_HOST: db
# networks:
# - laratt-network
networks:
laratt-network:
volumes:
redis-data: