Skip to content

Instantly share code, notes, and snippets.

@vermauv
Created March 7, 2019 10:45
Show Gist options
  • Save vermauv/f3e39cad04610e7e45cc6694bcd3eaa1 to your computer and use it in GitHub Desktop.
Save vermauv/f3e39cad04610e7e45cc6694bcd3eaa1 to your computer and use it in GitHub Desktop.
Docker file for nginx
FROM debian:jessie
RUN apt-get update && apt-get install -y wget curl
RUN echo "deb http://nginx.org/packages/debian/ jessie nginx" >> /etc/apt/sources.list
RUN echo "deb-src http://nginx.org/packages/debian/ jessie nginx" >> /etc/apt/sources.list
RUN wget http://nginx.org/packages/keys/nginx_signing.key
RUN cat nginx_signing.key | apt-key add -
RUN apt-get update
RUN apt-get install -y nginx
# Moving the tomcat server to /opt/tomcat
RUN ls -la && pwd
COPY ./load-balancer.conf /etc/nginx/conf.d/load-balancer.conf
COPY ./nginx.conf /etc/nginx/nginx.conf
RUN rm /etc/nginx/conf.d/default.conf
# RUN service nginx restart
# Exposing the port
RUN ln -sf /dev/stdout /var/log/nginx/access.log \
&& ln -sf /dev/stderr /var/log/nginx/error.log
EXPOSE 80
STOPSIGNAL SIGTERM
CMD ["nginx", "-g", "daemon off;"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment