FROM ubuntu

# Update the Sources
RUN apt-get update

# Install Nginx
RUN apt-get install -y nano wget dialog net-tools
RUN apt-get install -y nginx

# Remove the default files
RUN rm /etc/nginx/sites-available/default && rm /etc/nginx/sites-enabled/default

# Add the S3 Proxy Config File
ADD s3_proxy /etc/nginx/sites-available/s3_proxy

# Enable it by making a soft link
RUN ln -s /etc/nginx/sites-available/s3_proxy /etc/nginx/sites-enabled/s3_proxy

# Allow Nginx to run in non daemon mode so that the docker file continues to run
RUN echo "daemon off;" >> /etc/nginx/nginx.conf

# Expose the port
EXPOSE 80

# Start nginx
CMD service nginx start
