Skip to content

Instantly share code, notes, and snippets.

@petrozavodsky
Forked from DarthSim/Dockerfile
Created June 7, 2019 09:13
Show Gist options
  • Save petrozavodsky/22f616f0a8e8322ce3abcff9ab773fcb to your computer and use it in GitHub Desktop.
Save petrozavodsky/22f616f0a8e8322ce3abcff9ab773fcb to your computer and use it in GitHub Desktop.
imgproxy + nginx
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;
}
}
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"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment