Browse Source

Add dockerfile

Admin User 6 years ago
parent
commit
d881d99c39
3 changed files with 36 additions and 0 deletions
  1. 12 0
      Dockerfile
  2. 18 0
      default.conf
  3. 6 0
      nginx.repo

+ 12 - 0
Dockerfile

@@ -0,0 +1,12 @@
+FROM centos:7.4.1708 
+COPY nginx.repo /etc/yum.repos.d/nginx.repo
+RUN yum install -y epel-release \
+    && yum install yum-utils python2-certbot-nginx openssl ca-certificates nginx -y \
+    && mkdir -p /var/www/html/.well-known \
+    && ln -sf /dev/stdout /var/log/nginx/access.log \
+    && ln -sf /dev/stderr /var/log/nginx/error.log
+#COPY cli.ini /etc/letsencrypt/
+COPY default.conf /etc/nginx/conf.d/
+EXPOSE 80
+CMD ["nginx", "-g", "daemon off;"]
+

+ 18 - 0
default.conf

@@ -0,0 +1,18 @@
+server {
+	listen 80 default_server;
+#	listen [::]:80 default_server;
+        location /.well-known {
+            root /var/www/html;
+        }
+
+	# Everything is a 404
+	location / {
+		return 404;
+	}
+
+	# You may need this to prevent return 404 recursion.
+	location = /404.html {
+		internal;
+	}
+}
+

+ 6 - 0
nginx.repo

@@ -0,0 +1,6 @@
+[nginx]
+name=nginx repo
+baseurl=http://nginx.org/packages/centos/7/$basearch/
+gpgcheck=0
+enabled=1
+