This repository has been archived by the owner on Mar 13, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
67 lines (62 loc) · 1.78 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
version: "3"
services:
app:
image: thecodingmachine/php:8.0-v4-fpm
container_name: "${PROJECT_NAME}-php"
depends_on:
- db
volumes:
- ./app:/var/www/html:rw,cached
environment:
APP_ENV: "${APP_DEV}"
PHP_IDE_CONFIG: "serverName=${PROJECT_NAME}"
DATABASE_URL: "postgres://${DB_USER}:${DB_PWD}@${PROJECT_NAME}-db:5432/${DB_NAME}?sslmode=disable&charset=utf8"
PHP_EXTENSIONS: "pdo_pgsql pgsql pdo_sqlite sqlite3 gd intl xdebug"
PHP_INI_MEMORY_LIMIT: -1
PHP_INI_XDEBUG__MODE: "debug"
PHP_INI_XDEBUG__CLIENT_PORT: 9003
PHP_INI_XDEBUG__IDEKEY: "PHPSTORM"
PHP_EXTENSION_XDEBUG: 1
STARTUP_COMMAND_1: composer install --optimize-autoloader
STARTUP_COMMAND_2: echo 'alias sf="php bin/console"' >> ~/.bashrc
STARTUP_COMMAND_3: echo 'alias phpunit="php vendor/bin/simple-phpunit"' >> ~/.bashrc
restart: unless-stopped
caddy:
image: caddy
container_name: "${PROJECT_NAME}-caddy"
volumes:
- ./app:/var/www/html:ro
- ./app/docker/caddy/Caddyfile:/etc/caddy/Caddyfile:ro
- caddy_data:/data
- caddy_config:/config
environment:
PROJECT_NAME: ${PROJECT_NAME}
PROJECT_HOST: ${PROJECT_HOST}
ports:
# HTTP
- target: 80
published: 80
protocol: tcp
# HTTPS
- target: 443
published: 443
protocol: tcp
# HTTP/3
- target: 443
published: 443
protocol: udp
restart: unless-stopped
db:
image: postgres
container_name: "${PROJECT_NAME}-db"
environment:
POSTGRES_DB: ${DB_NAME}
POSTGRES_USER: ${DB_USER}
POSTGRES_PASSWORD: ${DB_PWD}
volumes:
- db_data:/var/lib/postgresql/data:rw
restart: unless-stopped
volumes:
db_data:
caddy_data:
caddy_config: