Skip to content

Commit

Permalink
drop output handling as it already happens; call original entrypoint
Browse files Browse the repository at this point in the history
  • Loading branch information
fabriciojs committed Mar 9, 2024
1 parent 076f688 commit 2d68f5b
Show file tree
Hide file tree
Showing 9 changed files with 60 additions and 20 deletions.
12 changes: 12 additions & 0 deletions fwd-template.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@
"name": "Dockerfile",
"path": "template/Dockerfile"
},
{
"name": "entrypoint.sh",
"path": "template/entrypoint"
},
{
"name": "default.tmpl",
"path": "template/default_tmpl"
Expand All @@ -30,6 +34,10 @@
"name": "Dockerfile",
"path": "template/Dockerfile"
},
{
"name": "entrypoint.sh",
"path": "template/entrypoint"
},
{
"name": "default.tmpl",
"path": "template/default_tmpl"
Expand All @@ -48,6 +56,10 @@
"name": "Dockerfile",
"path": "template/Dockerfile"
},
{
"name": "entrypoint.sh",
"path": "template/entrypoint"
},
{
"name": "default.tmpl",
"path": "template/default_tmpl"
Expand Down
10 changes: 5 additions & 5 deletions php/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,6 @@ RUN mkdir /etc/nginx/h5bp \
&& mv server-configs-nginx-*/mime.types /etc/nginx/mime.types \
&& rm -rf server-configs-nginx-*

# handle output
RUN ln -sf /dev/stdout /var/log/nginx/access.log \
&& ln -sf /dev/stderr /var/log/nginx/error.log \

WORKDIR /app

ENV LISTEN=80 \
Expand All @@ -36,7 +32,11 @@ ENV PHP_FPM=app:9000 \
FASTCGI_BUFFER_SIZE='16k'

COPY default.tmpl /etc/nginx/conf.d/default.tmpl
COPY entrypoint.sh /kool/entrypoint.sh

RUN chmod +x /kool/entrypoint.sh

EXPOSE 80

CMD ["dockerize", "-template", "/etc/nginx/conf.d/default.tmpl:/etc/nginx/conf.d/default.conf", "nginx", "-g", "daemon off;"]
ENTRYPOINT [ "/kool/entrypoint.sh" ]
CMD ["nginx", "-g", "daemon off;"]
7 changes: 7 additions & 0 deletions php/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/sh

set -e

dockerize -template /etc/nginx/conf.d/default.tmpl:/etc/nginx/conf.d/default.conf

exec sh /docker-entrypoint.sh "$@"
10 changes: 5 additions & 5 deletions proxy/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,6 @@ RUN mkdir /etc/nginx/h5bp \
&& mv server-configs-nginx-*/mime.types /etc/nginx/mime.types \
&& rm -rf server-configs-nginx-*

# handle output
RUN ln -sf /dev/stdout /var/log/nginx/access.log \
&& ln -sf /dev/stderr /var/log/nginx/error.log \

WORKDIR /app

ENV LISTEN=80 \
Expand All @@ -30,7 +26,11 @@ ENV LISTEN=80 \


COPY default.tmpl /etc/nginx/conf.d/default.tmpl
COPY entrypoint.sh /kool/entrypoint.sh

RUN chmod +x /kool/entrypoint.sh

EXPOSE 80

CMD ["dockerize", "-template", "/etc/nginx/conf.d/default.tmpl:/etc/nginx/conf.d/default.conf", "nginx", "-g", "daemon off;"]
ENTRYPOINT [ "/kool/entrypoint.sh" ]
CMD ["nginx", "-g", "daemon off;"]
7 changes: 7 additions & 0 deletions proxy/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/sh

set -e

dockerize -template /etc/nginx/conf.d/default.tmpl:/etc/nginx/conf.d/default.conf

exec sh /docker-entrypoint.sh "$@"
10 changes: 5 additions & 5 deletions static/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,6 @@ RUN mkdir /etc/nginx/h5bp \
&& mv server-configs-nginx-*/mime.types /etc/nginx/mime.types \
&& rm -rf server-configs-nginx-*

# handle output
RUN ln -sf /dev/stdout /var/log/nginx/access.log \
&& ln -sf /dev/stderr /var/log/nginx/error.log \

WORKDIR /app

ENV LISTEN=80 \
Expand All @@ -32,7 +28,11 @@ ENV INDEX=index.html \


COPY default.tmpl /etc/nginx/conf.d/default.tmpl
COPY entrypoint.sh /kool/entrypoint.sh

RUN chmod +x /kool/entrypoint.sh

EXPOSE 80

CMD ["dockerize", "-template", "/etc/nginx/conf.d/default.tmpl:/etc/nginx/conf.d/default.conf", "nginx", "-g", "daemon off;"]
ENTRYPOINT [ "/kool/entrypoint.sh" ]
CMD ["nginx", "-g", "daemon off;"]
7 changes: 7 additions & 0 deletions static/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/sh

set -e

dockerize -template /etc/nginx/conf.d/default.tmpl:/etc/nginx/conf.d/default.conf

exec sh /docker-entrypoint.sh "$@"
10 changes: 5 additions & 5 deletions template/Dockerfile.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,6 @@
&& mv server-configs-nginx-*/mime.types /etc/nginx/mime.types \
&& rm -rf server-configs-nginx-*

# handle output
RUN ln -sf /dev/stdout /var/log/nginx/access.log \
&& ln -sf /dev/stderr /var/log/nginx/error.log \

WORKDIR /app

ENV LISTEN=80 \
Expand All @@ -40,7 +36,11 @@
@endif

COPY default.tmpl /etc/nginx/conf.d/default.tmpl
COPY entrypoint.sh /kool/entrypoint.sh

RUN chmod +x /kool/entrypoint.sh

EXPOSE 80

CMD ["dockerize", "-template", "/etc/nginx/conf.d/default.tmpl:/etc/nginx/conf.d/default.conf", "nginx", "-g", "daemon off;"]
ENTRYPOINT [ "/kool/entrypoint.sh" ]
CMD ["nginx", "-g", "daemon off;"]
7 changes: 7 additions & 0 deletions template/entrypoint.blade.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/sh

set -e

dockerize -template /etc/nginx/conf.d/default.tmpl:/etc/nginx/conf.d/default.conf

exec sh /docker-entrypoint.sh "$@"

0 comments on commit 2d68f5b

Please sign in to comment.