Skip to content

Instantly share code, notes, and snippets.

@erangaeb
Created June 23, 2017 04:56
Show Gist options
  • Save erangaeb/9c919d59f5ee045a5da7bd762460f82b to your computer and use it in GitHub Desktop.
Save erangaeb/9c919d59f5ee045a5da7bd762460f82b to your computer and use it in GitHub Desktop.
docker file for nginx
FROM ubuntu:14.04
MAINTAINER Eranga Bandara ([email protected])
# install nginx
RUN apt-get update -y
RUN apt-get install -y python-software-properties
RUN apt-get install -y software-properties-common
RUN add-apt-repository -y ppa:nginx/stable
RUN apt-get update -y
RUN apt-get install -y nginx
# deamon mode off
RUN echo "\ndaemon off;" >> /etc/nginx/nginx.conf
RUN chown -R www-data:www-data /var/lib/nginx
# volume
VOLUME ["/etc/nginx/sites-enabled", "/etc/nginx/certs", "/var/log/nginx"]
# expose ports
EXPOSE 80 443
# add nginx conf
ADD config/nginx.conf /etc/nginx/conf.d/default.conf
WORKDIR /etc/nginx
CMD ["nginx"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment