Skip to content

Commit

Permalink
Fix fallback on api domain
Browse files Browse the repository at this point in the history
  • Loading branch information
PierreGauthier committed Oct 3, 2024
1 parent 6d13d4f commit 3e9fbee
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 14 deletions.
10 changes: 3 additions & 7 deletions compose.connectors.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
services:
php:
environment:
- TRUSTED_HOSTS=${TRUSTED_HOSTS:-^${API_SERVER_NAME:-example\.com|api.localhost}|php$$}

caddy:
proxy:
networks:
default:
aliases:
- ${API_SERVER_NAME:-api.localhost}
- ${API_SERVER_NAME:-api.gally.localhost}

networks:
networks:
default:
name: 'connectors-proxy'
6 changes: 3 additions & 3 deletions compose.override.yaml → compose.override.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ services:
target: gally_pwa_dev
args:
- NEXT_PUBLIC_ENTRYPOINT=${SERVER_NAME:-gally.localhost}
- NEXT_PUBLIC_API_URL=https://${SERVER_NAME:-${API_SERVER_NAME:-api.gally.localhost}}/${API_ROUTE_PREFIX:-}
- NEXT_PUBLIC_API_URL=https://${API_SERVER_NAME:-${SERVER_NAME:-api.gally.localhost}}/${API_ROUTE_PREFIX:-}
volumes:
- ./front:/usr/src/front:rw,cached,z
environment:
Expand All @@ -51,12 +51,12 @@ services:
additional_contexts:
front_src: ./front
args:
- REACT_APP_API_URL=https://${SERVER_NAME:-${API_SERVER_NAME:-api.gally.localhost}}/${API_ROUTE_PREFIX:-}
- REACT_APP_API_URL=https://${API_SERVER_NAME:-${SERVER_NAME:-api.gally.localhost}}/${API_ROUTE_PREFIX:-}
volumes:
- ./front:/usr/src/front:rw,cached,z
environment:
- PUBLIC_URL=https://${SERVER_NAME:-gally.localhost}/example
- REACT_APP_API_URL=https://${SERVER_NAME:-${API_SERVER_NAME:-api.gally.localhost}}/${API_ROUTE_PREFIX:-}
- REACT_APP_API_URL=https://${API_SERVER_NAME:-${SERVER_NAME:-api.gally.localhost}}/${API_ROUTE_PREFIX:-}

###> doctrine/doctrine-bundle ###
database:
Expand Down
8 changes: 4 additions & 4 deletions compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ services:
- SERVER_NAME=${SERVER_NAME:-${API_SERVER_NAME:-api.gally.localhost}}, php:80
- API_ROUTE_PREFIX=${API_ROUTE_PREFIX:-}
- TRUSTED_PROXIES=${TRUSTED_PROXIES:-127.0.0.0/8,10.0.0.0/8,172.16.0.0/12,192.168.0.0/16}
- TRUSTED_HOSTS=${TRUSTED_HOSTS:-^${SERVER_NAME:-example\.com|api.gally.localhost}|localhost|php$$}
- TRUSTED_HOSTS=${TRUSTED_HOSTS:-^${SERVER_NAME:-|gally.localhost}|${API_SERVER_NAME:-|api.gally.localhost}|localhost|php$$}
- CORS_ALLOW_ORIGIN=^https?://${SERVER_NAME:-gally.localhost}$
- GALLY_CATALOG_MEDIA_URL=${GALLY_CATALOG_MEDIA_URL:-https://${SERVER_NAME:-gally.localhost}/media/catalog/product/}
- DATABASE_URL=postgresql://${POSTGRES_USER:-app}:${POSTGRES_PASSWORD:-!ChangeMe!}@database:5432/${POSTGRES_DB:-app}?serverVersion=${POSTGRES_VERSION:-16}&charset=${POSTGRES_CHARSET:-utf8}
Expand All @@ -93,12 +93,12 @@ services:
front_src: ./front
args:
- NEXT_PUBLIC_ENTRYPOINT=${SERVER_NAME:-gally.localhost}
- NEXT_PUBLIC_API_URL=https://${SERVER_NAME:-${API_SERVER_NAME:-api.gally.localhost}}/${API_ROUTE_PREFIX:-}
- NEXT_PUBLIC_API_URL=https://${API_SERVER_NAME:-${SERVER_NAME:-api.gally.localhost}}/${API_ROUTE_PREFIX:-}
- REACT_APP_API_URL=https://${SERVER_NAME:-${API_SERVER_NAME:-api.gally.localhost}}/${API_ROUTE_PREFIX:-}
environment:
- NEXT_PUBLIC_ENTRYPOINT=${SERVER_NAME:-gally.localhost}
- NEXT_PUBLIC_API_URL=https://${SERVER_NAME:-${API_SERVER_NAME:-api.gally.localhost}}/${API_ROUTE_PREFIX:-}
- REACT_APP_API_URL=https://${SERVER_NAME:-${API_SERVER_NAME:-api.gally.localhost}}/${API_ROUTE_PREFIX:-}
- NEXT_PUBLIC_API_URL=https://${API_SERVER_NAME:-${SERVER_NAME:-api.gally.localhost}}/${API_ROUTE_PREFIX:-}
- REACT_APP_API_URL=https://${API_SERVER_NAME:-${SERVER_NAME:-api.gally.localhost}}/${API_ROUTE_PREFIX:-}
healthcheck:
test: test $$(curl --connect-timeout 2 -s -o /dev/null -w ''%{http_code}'' http://localhost:3000) -eq 200
interval: 10s
Expand Down

0 comments on commit 3e9fbee

Please sign in to comment.