Nginx using new logger and user

This commit is contained in:
Miguel Martinez 2015-06-03 19:37:53 -07:00
parent 308f9cf567
commit fcca834c14
3 changed files with 25 additions and 9 deletions

View File

@ -1,9 +1,11 @@
FROM ubuntu-debootstrap:14.04
MAINTAINER Bitnami
ENV BITNAMI_PREFIX=/usr/local/bitnami
ENV BITNAMI_APP_NAME nginxstandalonestack
ENV BITNAMI_APP_VERSION 1.8.0-0
ENV BITNAMI_APP_DIRNAME nginx
ENV BITNAMI_APP_VERSION 1.8.0-0
ENV BITNAMI_APP_DIR=$BITNAMI_PREFIX/$BITNAMI_APP_DIRNAME
ADD https://storage.googleapis.com/bitnami-artifacts/install.sh?GoogleAccessId=432889337695-e1gggo94k5qubupjsb35tajs91bdu0hg@developer.gserviceaccount.com&Expires=1434934078&Signature=QNkAu%2F8E2RlalSQy4n1sxMhsGKF%2FVltr6zu65HU6A9H0HKOgl6u9etqy9w6OwD4DsLMxYuy2uymOK3iDc5RbfkAMncKI1zJpxcwRQ4Mt43Oe8PBXKbQYcZ7mQaYPtpnjYblDs1S2p12Pu5NTDJHK2hJ1MrIUYwBup5n60R6OJRI%3D /tmp/install.sh
ADD post-install.sh /tmp/post-install.sh

View File

@ -1,10 +1,24 @@
#!/bin/bash
SERVICE_USER=daemon
if [ ! "$(ls -A /conf)" ]; then
cp -r /usr/local/bitnami/nginx/conf.defaults/* /usr/local/bitnami/nginx/conf
cp -r $BITNAMI_APP_DIR/conf.defaults/* $BITNAMI_APP_DIR/conf
fi
if [ ! "$(ls -A /app)" ]; then
cp -r /usr/local/bitnami/nginx/html.defaults/* /usr/local/bitnami/nginx/html
cp -r $BITNAMI_APP_DIR/html.defaults/* $BITNAMI_APP_DIR/html
fi
chown -R $SERVICE_USER:$SERVICE_USER /logs/ /conf/ /app/
if [ "$1" = 'nginx' ]; then
gosu $SERVICE_USER:$SERVICE_USER tail -f /logs/* &
fi
echo "#########################################################################"
echo "# #"
echo "# Bitnami Nginx container running: #"
echo "# #"
echo "#########################################################################"
exec "$@"

View File

@ -8,10 +8,10 @@ mv conf conf.defaults
mv html html.defaults
# Setup mount point symlinks
ln -s /usr/local/bitnami/nginx/conf /conf
ln -s /usr/local/bitnami/nginx/logs /logs
ln -s /usr/local/bitnami/nginx/html /app
ln -s $INSTALL_DIR/conf /conf
ln -s $INSTALL_DIR/logs /logs
ln -s $INSTALL_DIR/html /app
# TODO, this will not needed if the installer removes it.
rm $INSTALL_DIR/logs/NOTEMPTY
# Log to stdout
ln -sf /dev/stdout logs/access.log
ln -sf /dev/stderr logs/error.log