Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not loading ENV variable for NGINX API_KEY #10

Closed
1 task done
kellerfabian opened this issue Jan 28, 2024 · 0 comments
Closed
1 task done

Not loading ENV variable for NGINX API_KEY #10

kellerfabian opened this issue Jan 28, 2024 · 0 comments
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@kellerfabian
Copy link
Contributor

Is there an existing issue for this?

  • I have searched the existing issues

Product

Web API

Describe the bug

Proxy Docker container with nginx image is not consuming the provided API-Key

Steps to reproduce

using docker-compose.yml instruction:

  proxy:
    build: ./client/ByteBuoy.ProxyNginx/
    ports:
      - "8080:80"
    environment:
      - API_KEY=bb_JIIHHAA
      - API_SERVICE_URL=http://api:5000  

and using Dockerfile instructions

FROM nginx:latest

ENV API_KEY=XXXXX

COPY nginx.conf /etc/nginx/nginx.conf
#conf.d/default.conf

COPY default.conf.template /etc/nginx/templates/default.conf.template
#CMD /bin/bash -c "envsubst '$${API_KEY}' < /etc/nginx/templates/nginx.conf.template > /etc/nginx/nginx.conf && nginx -g 'daemon off;'"
# Command to run when the container starts
CMD /bin/bash -c "envsubst '$${API_KEY}' < /etc/nginx/templates/default.conf.template > /etc/nginx/nginx.conf && nginx -g 'daemon off;'"


# CMD nginx -g 'daemon off;'

Relevant log output

bytebuoy-proxy-1  | 2024/01/27 23:39:08 [emerg] 7#7: unknown "api_key" variable
bytebuoy-proxy-1  | nginx: [emerg] unknown "api_key" variable

Additional Context?

No response

Version

0.0.1

@kellerfabian kellerfabian added bug Something isn't working help wanted Extra attention is needed labels Jan 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant