You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
110 lines
3.2 KiB
110 lines
3.2 KiB
version: "3.4"
|
|
|
|
services:
|
|
php:
|
|
build:
|
|
context: .
|
|
target: app_php
|
|
args:
|
|
SYMFONY_VERSION: ${SYMFONY_VERSION:-}
|
|
STABILITY: ${STABILITY:-stable}
|
|
restart: unless-stopped
|
|
volumes:
|
|
- ./:/srv/app
|
|
- php_socket:/var/run/php
|
|
healthcheck:
|
|
interval: 10s
|
|
timeout: 3s
|
|
retries: 3
|
|
start_period: 30s
|
|
environment:
|
|
# Run "composer require symfony/orm-pack" to install and configure Doctrine ORM
|
|
DATABASE_URL: postgresql://${POSTGRES_USER:-symfony}:${POSTGRES_PASSWORD:-ChangeMe}@database:5432/${POSTGRES_DB:-app}?serverVersion=${POSTGRES_VERSION:-14}
|
|
# Run "composer require symfony/mercure-bundle" to install and configure the Mercure integration
|
|
MERCURE_URL: ${CADDY_MERCURE_URL:-http://caddy/.well-known/mercure}
|
|
MERCURE_PUBLIC_URL: https://${SERVER_NAME:-app.localhost}/.well-known/mercure
|
|
MERCURE_JWT_SECRET: ${CADDY_MERCURE_JWT_SECRET:-!ChangeThisMercureHubJWTSecretKey!}
|
|
|
|
caddy:
|
|
build:
|
|
context: .
|
|
target: app_caddy
|
|
depends_on:
|
|
- php
|
|
environment:
|
|
SERVER_NAME: ${SERVER_NAME:-app.localhost, caddy:80}
|
|
MERCURE_PUBLISHER_JWT_KEY: ${CADDY_MERCURE_JWT_SECRET:-!ChangeThisMercureHubJWTSecretKey!}
|
|
MERCURE_SUBSCRIBER_JWT_KEY: ${CADDY_MERCURE_JWT_SECRET:-!ChangeThisMercureHubJWTSecretKey!}
|
|
restart: unless-stopped
|
|
volumes:
|
|
- php_socket:/var/run/php
|
|
- caddy_data:/data
|
|
- caddy_config:/config
|
|
- ./:/srv/app:ro
|
|
|
|
ports:
|
|
# HTTP
|
|
- target: 80
|
|
published: ${HTTP_PORT:-80}
|
|
protocol: tcp
|
|
# HTTPS
|
|
- target: 443
|
|
published: ${HTTPS_PORT:-443}
|
|
protocol: tcp
|
|
# HTTP/3
|
|
- target: 443
|
|
published: ${HTTP3_PORT:-443}
|
|
protocol: udp
|
|
|
|
# elasticsearch:
|
|
## image: docker.elastic.co/elasticsearch/elasticsearch:7.4.0
|
|
# build:
|
|
# context: .
|
|
# target: symfony_elastic
|
|
# container_name: elasticsearch
|
|
# environment:
|
|
# - xpack.security.enabled=false
|
|
# - discovery.type=single-node
|
|
# ulimits:
|
|
# memlock:
|
|
# soft: -1
|
|
# hard: -1
|
|
# nofile:
|
|
# soft: 65536
|
|
# hard: 65536
|
|
# cap_add:
|
|
# - IPC_LOCK
|
|
# volumes:
|
|
# - elasticsearch-data:/usr/share/elasticsearch/data
|
|
|
|
###> doctrine/doctrine-bundle ###
|
|
database:
|
|
image: postgres:${POSTGRES_VERSION:-13}-alpine
|
|
environment:
|
|
POSTGRES_DB: ${POSTGRES_DB:-app}
|
|
# You should definitely change the password in production
|
|
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-ChangeMe}
|
|
POSTGRES_USER: ${POSTGRES_USER:-symfony}
|
|
volumes:
|
|
- db-data:/var/lib/postgresql/data:rw
|
|
# You may use a bind-mounted host directory instead, so that it is harder to accidentally remove the volume and lose all your data!
|
|
# - ./docker/db/data:/var/lib/postgresql/data:rw
|
|
ports:
|
|
- "5433:5432"
|
|
###< doctrine/doctrine-bundle ###
|
|
|
|
# Mercure is installed as a Caddy module, prevent the Flex recipe from installing another service
|
|
###> symfony/mercure-bundle ###
|
|
###< symfony/mercure-bundle ###
|
|
|
|
volumes:
|
|
php_socket:
|
|
caddy_data:
|
|
caddy_config:
|
|
elasticsearch-data:
|
|
driver: local
|
|
db-data:
|
|
|
|
###> symfony/mercure-bundle ###
|
|
###< symfony/mercure-bundle ###
|