Adding Nginx conf generation

This commit is contained in:
Miguel Martinez
2015-05-20 17:52:01 -07:00
parent ae22d89c23
commit 1d426b428f
2 changed files with 12 additions and 4 deletions
+7 -3
View File
@@ -10,14 +10,18 @@ RUN apt-get update -q && DEBIAN_FRONTEND=noninteractive apt-get install -qy wget
DEBIAN_FRONTEND=noninteractive apt-get --purge autoremove -qy wget && apt-get clean && rm -rf /var/lib/apt && rm -rf /var/cache/apt/archives/*
RUN mv /opt/bitnami/nginx/conf /opt/bitnami/nginx/conf.defaults && \
ln -s /opt/bitnami/nginx/conf/ /config && \
ln -s /opt/bitnami/nginx/logs/ /logs
mv /opt/bitnami/nginx/html /opt/bitnami/nginx/html.defaults && \
ln -s /opt/bitnami/nginx/conf/ /conf && \
ln -s /opt/bitnami/nginx/logs/ /logs && \
ln -s /opt/bitnami/nginx/html/ /app && \
ln -sf /dev/stdout /opt/bitnami/nginx/logs/access.log && \
ln -sf /dev/stderr /opt/bitnami/nginx/logs/error.log
ENV PATH /opt/bitnami/nginx/sbin:/opt/bitnami/common/bin:$PATH
EXPOSE 80 443
VOLUME ["/logs", "/config"]
VOLUME ["/logs", "/conf", "/app"]
COPY entrypoint.sh /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"]
+5 -1
View File
@@ -1,6 +1,10 @@
#!/bin/bash
if [ ! "$(ls -A /config)" ]; then
if [ ! "$(ls -A /conf)" ]; then
cp -r /opt/bitnami/nginx/conf.defaults/* /opt/bitnami/nginx/conf
fi
if [ ! "$(ls -A /app)" ]; then
cp -r /opt/bitnami/nginx/html.defaults/* /opt/bitnami/nginx/html
fi
exec "$@"