From 4ff5cc2728cf216879c178734efe3e69bfa7586a Mon Sep 17 00:00:00 2001 From: gyurix Date: Fri, 28 Jun 2024 12:09:39 +0200 Subject: [PATCH] added drone and nginx files --- .drone.yml | 33 +++++++++++++++++++++++++ Dockerfile | 72 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ nginx.conf | 39 +++++++++++++++++++++++++++++ 3 files changed, 144 insertions(+) create mode 100644 .drone.yml create mode 100644 Dockerfile create mode 100644 nginx.conf diff --git a/.drone.yml b/.drone.yml new file mode 100644 index 0000000..2af9399 --- /dev/null +++ b/.drone.yml @@ -0,0 +1,33 @@ +kind: pipeline +name: default +trigger: + branch: + - master + event: + - push +workspace: + path: /drone/src + +environment: + REPO_NAME: web-installer + IMAGE_NAME: web-installer + REGISTRY_SERVER_NAME: registry.format.hu + +steps: + - name: build image + image: plugins/docker + commands: + - cd /drone/src/ + - docker build -t $${REGISTRY_SERVER_NAME}/$${IMAGE_NAME} -f Dockerfile . + - docker push $${REGISTRY_SERVER_NAME}/$${IMAGE_NAME} + when: + branch: + - master + volumes: + - name: docker + path: /var/run/docker.sock + +volumes: + - name: docker + host: + path: /var/run/docker.sock diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..f61f3ba --- /dev/null +++ b/Dockerfile @@ -0,0 +1,72 @@ +FROM alpine:latest + +ENV NGINX_VERSION=1.25.4 + +RUN \ + build_pkgs="build-base linux-headers openssl-dev pcre-dev wget zlib-dev" && \ + runtime_pkgs="ca-certificates openssl pcre zlib tzdata git" && \ + apk --no-cache add ${build_pkgs} ${runtime_pkgs} && \ + cd /tmp && \ + wget https://nginx.org/download/nginx-${NGINX_VERSION}.tar.gz && \ + tar xzf nginx-${NGINX_VERSION}.tar.gz && \ + cd /tmp/nginx-${NGINX_VERSION} && \ + ./configure \ + --prefix=/etc/nginx \ + --sbin-path=/usr/sbin/nginx \ + --conf-path=/etc/nginx/nginx.conf \ + --error-log-path=/var/log/nginx/error.log \ + --http-log-path=/var/log/nginx/access.log \ + --pid-path=/var/run/nginx.pid \ + --lock-path=/var/run/nginx.lock \ + --http-client-body-temp-path=/var/cache/nginx/client_temp \ + --http-proxy-temp-path=/var/cache/nginx/proxy_temp \ + --http-fastcgi-temp-path=/var/cache/nginx/fastcgi_temp \ + --http-uwsgi-temp-path=/var/cache/nginx/uwsgi_temp \ + --http-scgi-temp-path=/var/cache/nginx/scgi_temp \ + --user=nginx \ + --group=nginx \ + --with-http_ssl_module \ + --with-http_realip_module \ + --with-http_addition_module \ + --with-http_sub_module \ + --with-http_dav_module \ + --with-http_flv_module \ + --with-http_mp4_module \ + --with-http_gunzip_module \ + --with-http_gzip_static_module \ + --with-http_random_index_module \ + --with-http_secure_link_module \ + --with-http_stub_status_module \ + --with-http_auth_request_module \ + --with-mail \ + --with-mail_ssl_module \ + --with-file-aio \ + --with-threads \ + --with-stream \ + --with-stream_ssl_module \ + --with-stream_realip_module \ + --with-http_slice_module \ + --with-http_v2_module && \ + make && \ + make install && \ + sed -i -e 's/#access_log logs\/access.log main;/access_log \/dev\/stdout;/' -e 's/#error_log logs\/error.log notice;/error_log stderr notice;/' /etc/nginx/nginx.conf && \ + addgroup -S nginx && \ + adduser -D -S -h /var/cache/nginx -s /sbin/nologin -G nginx nginx && \ + rm -rf /tmp/* && \ + apk del ${build_pkgs} && \ + rm -rf /var/cache/apk/* + +COPY nginx.conf /etc/nginx/nginx.conf + +RUN mkdir -p /usr/share/nginx/html + +COPY index.html /usr/share/nginx/html +COPY install.php /usr/share/nginx/html + +RUN chown -R nginx:nginx /usr/share/nginx/html + +VOLUME ["/var/cache/nginx"] + +EXPOSE 80 + +CMD nginx diff --git a/nginx.conf b/nginx.conf new file mode 100644 index 0000000..f860c68 --- /dev/null +++ b/nginx.conf @@ -0,0 +1,39 @@ +# run nginx in foreground +daemon off; + +worker_processes 1; + +error_log stderr notice; + +events { + worker_connections 1024; +} + + +http { + include mime.types; + include /etc/nginx/conf.d/*.conf; + default_type application/octet-stream; + server_names_hash_bucket_size 128; + + access_log /dev/stdout; + + sendfile on; + + keepalive_timeout 65; + + server { + listen 80; + server_name localhost; + location / { + root /usr/share/nginx/html; + index index.html + } + + error_page 500 502 503 504 /50x.html; + location = /50x.html { + root html; + } + } +} +