Created
November 13, 2014 19:40
-
-
Save lrvick/d0cbcb84b04a92d0cdbf to your computer and use it in GitHub Desktop.
Dockerfile for simple nginx static hosting
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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