diff --git a/nodeapp/Dockerfile b/nodeapp/Dockerfile index df1b15f9..d351b6a7 100644 --- a/nodeapp/Dockerfile +++ b/nodeapp/Dockerfile @@ -1,8 +1,14 @@ FROM alpine:3.18.0 +LABEL maintainer="Reckless_Satoshi https://github.com/reckless-satoshi" + RUN mkdir -p /usr/src/robosats WORKDIR /usr/src/robosats +RUN set -x \ + && addgroup -g 101 -S nginx \ + && adduser -S -D -H -u 101 -h /var/cache/nginx -s /sbin/nologin -G nginx -g nginx nginx + COPY . . COPY ./nginx.conf /etc/nginx/nginx.conf diff --git a/nodeapp/nginx.conf b/nodeapp/nginx.conf index be1ad2f3..89b4e494 100644 --- a/nodeapp/nginx.conf +++ b/nodeapp/nginx.conf @@ -1,11 +1,30 @@ +daemon off; + +user nginx; worker_processes auto; +error_log /var/log/nginx/error.log notice; +pid /var/run/nginx.pid; + events { worker_connections 1024; } http { + include /etc/nginx/mime.types; + default_type application/octet-stream; + + log_format main '$remote_addr - $remote_user [$time_local] "$request" ' + '$status $body_bytes_sent "$http_referer" ' + '"$http_user_agent" "$http_x_forwarded_for"'; + + access_log /dev/stdout main; + error_log /dev/stderr warn; + + sendfile on; + keepalive_timeout 65; + # Every robosat coordinators socat tor bridge is an upstream. # So far only the experimental coordinator is available. upstream experimental_coordinator { @@ -17,8 +36,6 @@ http { listen 12596; server_name robosats_client; - include /etc/nginx/mime.types; - location / { root /usr/src/robosats; try_files $uri $uri/ /basic.html; diff --git a/nodeapp/robosats-client.sh b/nodeapp/robosats-client.sh index d61f2d75..146ccae1 100644 --- a/nodeapp/robosats-client.sh +++ b/nodeapp/robosats-client.sh @@ -10,4 +10,4 @@ experimental_onion=robosats6tkf3eva7x2voqso3a5wcorsnw34jveyxfqi2fu7oyheasid.onion experimental_socat="socat tcp4-LISTEN:81,reuseaddr,fork,keepalive,bind=127.0.0.1 SOCKS4A:${TOR_PROXY_IP:-127.0.0.1}:${experimental_onion}:80,socksport=${TOR_PROXY_PORT:-9050}" -$experimental_socat & nginx -g "daemon off;" \ No newline at end of file +$experimental_socat & nginx \ No newline at end of file