Skip to content

Instantly share code, notes, and snippets.

@lrvick
Created November 13, 2014 19:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lrvick/d0cbcb84b04a92d0cdbf to your computer and use it in GitHub Desktop.
Save lrvick/d0cbcb84b04a92d0cdbf to your computer and use it in GitHub Desktop.
Dockerfile for simple nginx static hosting
#Get latest debian image
FROM debian:wheezy
RUN echo "deb http://nginx.org/packages/debian/ wheezy nginx" >> /etc/apt/sources.list.d/nginx.list
RUN apt-key adv --fetch-keys "http://nginx.org/keys/nginx_signing.key"
# Update package repos
RUN apt-get update -y --fix-missing
RUN apt-get upgrade -y --fix-missing
# Install system deps
RUN apt-get install -y --force-yes \
nginx \
openssl \
ca-certificates
# Setup Nginx
RUN rm -rf /etc/nginx/conf.d/*
ADD nginx.conf /etc/nginx/nginx.conf
# Copy app files to working directory
ADD static /app
RUN chown -R nginx:nginx /app
# Expose port 80/443 to outside world
EXPOSE 80
EXPOSE 443
# Default command to run on boot
ENTRYPOINT ["nginx"]
CMD []
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment