various fixes

This commit is contained in:
Ivann LARUELLE 2023-02-21 21:46:08 +01:00
parent 6070adcae1
commit 2e425e16e0
4 changed files with 36 additions and 3 deletions

View File

@ -72,4 +72,5 @@ framework:
trusted_headers: ['x-forwarded-for', 'x-forwarded-host', 'x-forwarded-proto', 'x-forwarded-port', 'x-forwarded-prefix']
```
définir la variable d'env TRUSTED_PROXIES avec le/les réseaux ou IP spécfiques (séparés par des virgules, réseaux en notation CIDR)
définir la variable d'env TRUSTED_PROXIES avec le/les réseaux ou IP spécfiques (séparés par des virgules, réseaux en notation CIDR)
dans le `.env` : `TRUSTED_PROXIES=""`

View File

@ -8,6 +8,7 @@ services:
DATABASE_URL: "postgresql://app:app@database:5432/app?serverVersion=14&charset=utf8"
MAILER_DSN: "smtp://mailer:1025"
PHP_IDE_CONFIG: "serverName=docker"
TRUSTED_PROXIES: "0.0.0.0/0"
XDEBUG_MODE: "develop,debug" # profile,coverage
XDEBUG_CONFIG: "client_host=host.docker.internal"
XDEBUG_TRIGGER: "yes"

View File

@ -0,0 +1,31 @@
# This must be done only once for every computer (it can be used for every web project, not only this one)
# 1. Launch WSL/Ubuntu
# 2. Go to your etuutt-api directory
# 3. Create traefik docker-compose : `mkdir -p ${HOME}/programmation/traefik && cp docker-compose.traefik.yml ${HOME}/programmation/traefik/docker-compose.yml && cd ${HOME}/programmation/traefik`
# 4. Create docker network for traefik to link all containers to it : `docker network create traefik`
# 5. Launch it : `cd ${HOME}/programmation/traefik && docker compose up -d`
# Thanks to the `restart: always` directive, traefik will launch every time docker launches, so no need to launch it by hand every time. It uses very few ram and cpu.
# If you still want to shut it down for good : `cd ${HOME}/programmation/traefik && docker compose down`
# To restart it : `cd ${HOME}/programmation/traefik && docker compose up -d`
version: '3'
services:
reverse-proxy:
image: traefik:v2.9
restart: always
networks:
- traefik
command:
- '--api.insecure=true'
- '--providers.docker'
ports:
- "80:80"
- "9081:8080" # UI
volumes:
- /var/run/docker.sock:/var/run/docker.sock
networks:
traefik:
external: true

View File

@ -30,7 +30,7 @@ services:
timeout: 5s
retries: 5
volumes:
- db-data:/var/lib/postgresql/data:rw
- database-data:/var/lib/postgresql/data:rw
volumes:
db-data:
database-data: