Skip to content

Commit

Permalink
Deploy nginx as a separate heroku app (#140)
Browse files Browse the repository at this point in the history
  • Loading branch information
sgalsaleh authored Mar 15, 2024
1 parent b186cc1 commit 9f724f1
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 5 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,13 @@ jobs:
run: heroku container:release -a ttlsh web

- name: build nginx
run: docker build -t registry.heroku.com/ttlsh/nginx nginx
run: docker build -t registry.heroku.com/ttlsh-router/nginx nginx

- name: push nginx
run: docker push registry.heroku.com/ttlsh/nginx
run: docker push registry.heroku.com/ttlsh-router/nginx

- name: release nginx
run: heroku container:release -a ttlsh nginx
run: heroku container:release -a ttlsh-router nginx

- name: build hooks
run: docker build -f hooks/Dockerfile.hooks -t registry.heroku.com/ttlsh-hooks/web hooks
Expand Down
4 changes: 3 additions & 1 deletion nginx/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,6 @@ COPY src/favicon.ico /usr/share/nginx/html/
COPY src/index.htm /usr/share/nginx/html/
COPY src/ttlsh_files /usr/share/nginx/html/ttlsh_files/

EXPOSE 8080
ADD entrypoint.sh /entrypoint.sh

ENTRYPOINT ["/entrypoint.sh"]
7 changes: 7 additions & 0 deletions nginx/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/sh

set -e

sed -i "s/__PORT__/$PORT/g" /etc/nginx/nginx.conf

exec "$@"
2 changes: 1 addition & 1 deletion nginx/nginx.conf
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
events {}
http {
server {
listen 8080;
listen __PORT__;
server_name ttl.sh;

location /v2 {
Expand Down

0 comments on commit 9f724f1

Please sign in to comment.