Skip to content

Instantly share code, notes, and snippets.

@DarthSim
Created May 20, 2019 12:25
Show Gist options
  • Save DarthSim/a5ad15ba399eb9166cef546eb2d31278 to your computer and use it in GitHub Desktop.
Save DarthSim/a5ad15ba399eb9166cef546eb2d31278 to your computer and use it in GitHub Desktop.

Revisions

  1. DarthSim created this gist May 20, 2019.
    15 changes: 15 additions & 0 deletions Dockerfile
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,15 @@
    FROM darthsim/imgproxy:latest

    RUN echo "http://dl-cdn.alpinelinux.org/alpine/edge/testing" >> /etc/apk/repositories \
    && apk --no-cache upgrade \
    && apk add --no-cache nginx

    RUN echo -e "#!/bin/bash\nnginx && imgproxy" > /usr/local/bin/imgproxy-nginx
    RUN chmod +x /usr/local/bin/imgproxy-nginx
    RUN mkdir -p /run/nginx

    ADD default.conf /etc/nginx/conf.d/default.conf
    ADD cert.pem /etc/nginx/ssl/cert.pem
    ADD key.pem /etc/nginx/ssl/key.pem

    CMD ["/usr/local/bin/imgproxy-nginx"]
    21 changes: 21 additions & 0 deletions default.conf
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,21 @@
    server {
    listen 443 default_server ssl;
    listen [::]:443 default_server ssl;

    client_max_body_size 32M;

    ssl_certificate /etc/nginx/ssl/cert.pem;
    ssl_certificate_key /etc/nginx/ssl/key.pem;

    keepalive_timeout 60;
    ssl_session_timeout 5m;

    ssl_protocols SSLv2 SSLv3 TLSv1;
    ssl_ciphers ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP;
    ssl_prefer_server_ciphers on;

    location / {
    proxy_pass "http://127.0.0.1:8080";
    proxy_redirect off;
    }
    }