Ver Fonte

Start process by shell.

Rafa Couto há 9 anos atrás
pai
commit
5e22ff2383
2 ficheiros alterados com 18 adições e 9 exclusões
  1. 5 9
      Dockerfile
  2. 13 0
      privoxy-start.sh

+ 5 - 9
Dockerfile

@@ -3,16 +3,12 @@ FROM alpine:latest
 
 MAINTAINER caligari@treboada.net
 
-EXPOSE 8118
-
 RUN apk --no-cache add privoxy 
+ADD privoxy-start.sh /usr/local/bin/
+ADD config /etc/privoxy/
+RUN chmod +r /etc/privoxy/config && chmod +x /usr/local/bin/privoxy-start.sh
 
-COPY config /etc/privoxy/config
-
-RUN chown privoxy:privoxy /etc/privoxy/config
-
-VOLUME /etc/privoxy
-
-CMD /usr/sbin/privoxy --no-daemon --user privoxy.privoxy /etc/privoxy/config
+CMD ["privoxy-start.sh"]
 
+EXPOSE 8118
 

+ 13 - 0
privoxy-start.sh

@@ -0,0 +1,13 @@
+#!/bin/sh
+
+CONFFILE=/etc/privoxy/config
+PIDFILE=/var/run/privoxy.pid
+
+
+if [ ! -f "${CONFFILE}" ]; then
+	echo "Configuration file ${CONFFILE} not found!"
+	exit 1
+fi
+
+/usr/sbin/privoxy --no-daemon --pidfile "${PIDFILE}" "${CONFFILE}"
+