uffizzi
uffizzi copied to clipboard
Escape env var substitution for env vars passed with an extra `$`, eg: `$$UFFIZZI_URL`
Describe the bug
When passing ENDPOINT=$$UFFIZZI_URL node start
as a value in the docker-compose command
spec, $$UFFIZZI_URL
is not escaped.
https://stackoverflow.com/questions/40447029/docker-compose-environment-variable-for-command
Expected behavior
$$UFFIZZI_URL
is not set during parsing the docker-compose an d is escaped instead.
Instead $UFFIZZI_URL
is then picked up from the container.
Additional context This is a workaround for https://github.com/UffizziCloud/uffizzi_app/issues/251
docker-compose
command: "ENDPOINT=$$UFFIZZI_URL node start"
kubernetes manifest
container:
command: "ENDPOINT=$UFFIZZI_URL node start"
Docker Docs reference: https://docs.docker.com/compose/compose-file/#variable-substitution
@waveywaves Can you please provide a compose file example to test?
@moklidia here you go
# This compose file is for demonstration only, do not use in prod.
version: "3.9"
x-uffizzi:
ingress:
service: app
port: 3001
services:
app:
depends_on:
- "postgres"
image: ghcr.io/logto-io/logto:prerelease
ports:
- 3001:3001
environment:
ALL_YES: 1
NO_INQUIRY: 0
TRUST_PROXY_HEADER: 1
DB_URL_DEFAULT: postgres://postgres:p0stgr3s@localhost:5432
deploy:
resources:
limits:
memory: 2000M
command: "ENDPOINT=$$UFFIZZI_URL node start"
postgres:
image: postgres:14-alpine
user: postgres
environment:
POSTGRES_USER: "postgres"
POSTGRES_PASSWORD: "p0stgr3s"
deploy:
resources:
limits:
memory: 500M
@waveywaves I try to reproduce this case and it works
version: '3'
services:
app:
build:
context: https://github.com/zipofar/test_node
dockerfile: Dockerfile
entrypoint: /bin/bash
command:
- "-c"
- "ENDPOINT=$$UFFIZZI_URL node /app/app/app.js"
x-uffizzi:
ingress:
service: app
port: 80
continuous_preview:
delete_preview_after: 10h
Describe:
I think this problem was because we should set entrypoint
and set command
like example above. It looks like the command
prop does not user friendly at this moment.
My github repo
This is helpful @zipofar. Glad to know its not really a bug then. I will test this out once. This helps reduce the configuration files for logto immediately. 🙂
Closing this as this already works and we have found a way to use this from the docker-compose file.
Reopening as https://github.com/UffizziCloud/uffizzi/issues/261#issuecomment-1317118658 only works on platform and not via the CLI