use intermediate image to eval nginx.conf.tmpl at build time

pull/6/head
Matthew Strasiotto 4 years ago
parent e3ce304a27
commit ad72499d1f

@ -4,9 +4,9 @@ services:
build: ./nginx/
container_name: webserver
volumes:
- type: bind
source: ./nginx/nginx.conf
target: /etc/nginx/nginx.conf
# - type: bind
# source: ./nginx/nginx.conf
# target: /etc/nginx/nginx.conf
- ./nginx/log/:/var/log/nginx/
- /etc/letsencrypt/:/etc/letsencrypt/
ports:

@ -1,5 +1,13 @@
FROM nginx
FROM ruby as template
ADD "nginx.conf.tmpl" "nginx.yaml" "/build/"
RUN gem install mustache \
&& cd /build \
&& mustache nginx.yaml nginx.conf.tmpl > nginx.conf
FROM nginx:latest
#RUN apt-get update && apt-get install --no-install-recommends --no-install-suggests -y libnginx-mod-stream
COPY --from=template /build/nginx.conf /etc/nginx/nginx.conf
RUN apt-get update \
&& apt-get install --no-install-recommends --no-install-suggests -y libnginx-mod-stream

Loading…
Cancel
Save