-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
executable file
·77 lines (72 loc) · 2.08 KB
/
docker-compose.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
version: "3.7"
services:
php-fpm:
build:
args:
PHP_VERSION: '${PHP_VERSION:-8.2.0}'
context: ./docker/php-fpm
dockerfile: Dockerfile
container_name: '${APP_NAME:-laravel}-php-fpm'
working_dir: '/var/www'
volumes:
- './:/var/www'
- './docker/php-fpm/xdebug.ini:/usr/local/etc/php/conf.d/xdebug.ini'
- './docker/php-fpm/php.ini:/usr/local/etc/php/php.ini'
networks:
- laravel
# Nginx
nginx:
image: nginx:latest
container_name: '${APP_NAME:-laravel}-nginx'
restart: unless-stopped
ports:
- '${FORWARD_HOST:-127.0.0.1}:${FORWARD_NGINX_PORT:-8081}:8081'
environment:
NGINX_PORT: '${APP_PORT:-80}'
NGINX_HOST: '${APP_DOMAIN:-localhost}'
volumes:
- './:/var/www'
- './docker/nginx/templates:/etc/nginx/templates'
- './docker/nginx/nginx.conf:/etc/nginx/nginx.conf'
depends_on:
- php-fpm
networks:
- laravel
# Postgresql
pgsql:
image: postgres:latest
container_name: '${APP_NAME:-laravel}-pgsql'
restart: unless-stopped
environment:
PGPASSWORD: '${DB_PASSWORD:-sectet}'
POSTGRES_DB: '${DB_DATABASE:-laravel}'
POSTGRES_USER: '${DB_USERNAME:-laravel}'
POSTGRES_PASSWORD: '${DB_PASSWORD:-sectet}'
ports:
- '${FORWARD_HOST:-127.0.0.1}:${FORWARD_DB_PORT:-5432}:5432'
volumes:
- './docker/postgres/initdb.d:/docker-entrypoint-initdb.d'
- '~/Databases/postgresql/${APP_NAME:-laravel}:/var/lib/postgresql/data'
networks:
- laravel
healthcheck:
test: ["CMD", "pg_isready", "-q", "-d", "${DB_USERNAME:-root}", "-U", "${DB_USERNAME:-root}"]
retries: 3
timeout: 5s
# Redis
redis:
image: redis:alpine
container_name: '${APP_NAME:-laravel}-redis'
ports:
- '${FORWARD_HOST:-127.0.0.1}:${FORWARD_REDIS_PORT:-6379}:6379'
volumes:
- './docker/redis/redis.conf:/usr/local/etc/redis/redis.conf'
networks:
- laravel
healthcheck:
test: ["CMD", "redis-cli", "ping"]
retries: 3
timeout: 5s
networks:
laravel:
driver: bridge