mirror of
https://github.com/bitnami/containers.git
synced 2026-10-17 16:33:55 +02:00
Adding Nginx conf generation
This commit is contained in:
@@ -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"]
|
||||
|
||||
@@ -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 "$@"
|
||||
|
||||
Reference in New Issue
Block a user