fork download
  1. # Containerfile_NginX
  2.  
  3. # Set master image.
  4. FROM registry.opensuse.org/opensuse/nginx:latest
  5.  
  6. # Install NginX.
  7. RUN zypper -n install \
  8. curl \
  9. wget \
  10. nano \
  11. iputils \
  12. netcat-openbsd \
  13. net-tools \
  14. nginx
  15.  
  16. # Add nginx user and group if they don't exist
  17. RUN getent group nginx || groupadd -r nginx && \
  18. getent passwd nginx || useradd -r -g nginx nginx
  19.  
  20. # Add NginX config
  21. COPY ./nginx/nginx.conf /etc/nginx/nginx.conf
  22.  
  23. # Create directories
  24. RUN mkdir -p /srv/www/htdocs && \
  25. chmod -R 755 /srv/www/htdocs
  26.  
  27. # Set working directory.
  28. WORKDIR /srv/www/htdocs
  29.  
  30. # Set volumes.
  31. ADD ["htdocs", "/srv/www/htdocs"]
  32.  
  33. # Expose port 80, 443.
  34. EXPOSE 80 443
  35.  
  36. # Start NginX through bash terminal.
  37. CMD ["/bin/bash", "-c", "nginx -g 'daemon off;'"]
  38.  
Not running #stdin #stdout 0s 0KB
stdin
Standard input is empty
stdout
Standard output is empty