Skip to content

Commit

Permalink
Attempt to add ability to set enviroment variable to be passed to nginx
Browse files Browse the repository at this point in the history
  • Loading branch information
starsoccer committed Sep 13, 2023
1 parent 1e1152f commit dbd6bfa
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 2 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ services:
restart: always
energysmart-proxy:
build: ./energysmart-proxy
environment:
- PROXY_PASS_LOCATION=energysmart-bridge:8001
ports:
- "443:443"
restart: always
4 changes: 2 additions & 2 deletions energysmart-proxy/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ FROM nginx:1.24

RUN apt-get update && apt-get install -y openssl

COPY nginx.conf /etc/nginx/
COPY nginx.conf.template .

RUN openssl req -nodes -new -x509 -sha1 -subj '/CN=energysmartwaterheater.com' -keyout /etc/nginx/energysmartwaterheater.com.key -out /etc/nginx/energysmartwaterheater.com.crt -days 3650

EXPOSE 443/tcp

CMD ["nginx", "-g", "daemon off;"]
CMD ["/bin/sh" , "-c" , "envsubst < /nginx.conf.template > /etc/nginx/nginx.conf && exec nginx -g 'daemon off;'"]
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ stream {
server {
listen 443 ssl;
proxy_pass 192.168.0.241:8001;
resolver 192.168.0.1;

ssl_certificate /etc/nginx/energysmartwaterheater.com.crt;
ssl_certificate_key /etc/nginx/energysmartwaterheater.com.key;
Expand Down

0 comments on commit dbd6bfa

Please sign in to comment.