Initial commit
This commit is contained in:
41
Dockerfile
Normal file
41
Dockerfile
Normal file
@@ -0,0 +1,41 @@
|
|||||||
|
FROM alpine:latest
|
||||||
|
MAINTAINER Jeroen Geusebroek <me@jeroengeusebroek.nl>
|
||||||
|
|
||||||
|
ARG VERSION=1.1
|
||||||
|
|
||||||
|
ENV GID=991 UID=991
|
||||||
|
|
||||||
|
RUN apk -U add \
|
||||||
|
curl \
|
||||||
|
nginx \
|
||||||
|
php7-fpm \
|
||||||
|
php7-gd \
|
||||||
|
php7-mcrypt \
|
||||||
|
php7-json \
|
||||||
|
php7-zlib \
|
||||||
|
supervisor \
|
||||||
|
tini \
|
||||||
|
ca-certificates \
|
||||||
|
tar \
|
||||||
|
|
||||||
|
&& mkdir privatebin && cd privatebin \
|
||||||
|
&& curl -L -o privatebin.tar.gz https://github.com/PrivateBin/PrivateBin/archive/$VERSION.tar.gz \
|
||||||
|
&& tar xvzf privatebin.tar.gz --strip 1 \
|
||||||
|
&& rm privatebin.tar.gz \
|
||||||
|
|
||||||
|
&& mv cfg/conf.ini.sample /privatebin \
|
||||||
|
&& apk del tar ca-certificates curl libcurl \
|
||||||
|
&& rm -f /var/cache/apk/*
|
||||||
|
|
||||||
|
COPY files/nginx.conf /etc/nginx/nginx.conf
|
||||||
|
COPY files/php-fpm.conf /etc/php7/php-fpm.conf
|
||||||
|
COPY files/supervisord.conf /usr/local/etc/supervisord.conf
|
||||||
|
COPY entrypoint.sh /
|
||||||
|
|
||||||
|
RUN chmod +x /entrypoint.sh
|
||||||
|
|
||||||
|
VOLUME [ "/privatebin/data", "/privatebin/cfg" ]
|
||||||
|
|
||||||
|
EXPOSE 80
|
||||||
|
LABEL description "PrivateBin is a minimalist, open source online pastebin where the server has zero knowledge of pasted data."
|
||||||
|
CMD ["/sbin/tini","--","/entrypoint.sh"]
|
||||||
8
LICENSE
Normal file
8
LICENSE
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
The MIT License (MIT)
|
||||||
|
Copyright (c) 2016 Jeroen Geusebroek
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
29
README.md
Normal file
29
README.md
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
[](https://microbadger.com/images/jgeusebroek/privatebin "Get your own image badge on microbadger.com")
|
||||||
|
# Docker Privatebin image
|
||||||
|
|
||||||
|
A tiny image running [alpine](https://github.com/gliderlabs/docker-alpine) Linux and [Privatebin](https://github.com/PrivateBin/PrivateBin).
|
||||||
|
|
||||||
|
## Usage
|
||||||
|
|
||||||
|
docker run --restart=always -d \
|
||||||
|
-p 0.0.0.0:80:80 \
|
||||||
|
--hostname=privatebin \
|
||||||
|
--name=privatebin \
|
||||||
|
-v /<host_data_directory>:/privatebin/data \
|
||||||
|
-v /<host_cfg_directory>:/privatebin/cfg \
|
||||||
|
jgeusebroek/privatebin
|
||||||
|
|
||||||
|
On first run it will copy the sample config file if there isn't a config file already.
|
||||||
|
|
||||||
|
## Optional environment variables
|
||||||
|
|
||||||
|
* `UID` User ID php fpm daemon account (default: 991).
|
||||||
|
* `GID` Group ID php fpm daemon account (default: 991).
|
||||||
|
|
||||||
|
## License
|
||||||
|
|
||||||
|
MIT / BSD
|
||||||
|
|
||||||
|
## Author Information
|
||||||
|
|
||||||
|
[Jeroen Geusebroek](http://jeroengeusebroek.nl/)
|
||||||
2
build.sh
Executable file
2
build.sh
Executable file
@@ -0,0 +1,2 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
docker build --rm -t jgeusebroek/privatebin .
|
||||||
2
buildNoCache.sh
Executable file
2
buildNoCache.sh
Executable file
@@ -0,0 +1,2 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
docker build --rm --pull --no-cache -t jgeusebroek/zerobin .
|
||||||
11
entrypoint.sh
Normal file
11
entrypoint.sh
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
addgroup -g ${GID} privatebin && adduser -h /privatebin -s /bin/sh -D -G privatebin -u ${UID} privatebin
|
||||||
|
touch /var/run/php-fpm.sock
|
||||||
|
|
||||||
|
if [ ! -f /privatebin/cfg/conf.ini ]; then
|
||||||
|
cp /privatebin/conf.ini.sample /privatebin/cfg/conf.ini
|
||||||
|
fi
|
||||||
|
|
||||||
|
chown -R privatebin:privatebin /privatebin /var/run/php-fpm.sock /var/lib/nginx /tmp
|
||||||
|
supervisord -c /usr/local/etc/supervisord.conf
|
||||||
84
files/nginx.conf
Normal file
84
files/nginx.conf
Normal file
@@ -0,0 +1,84 @@
|
|||||||
|
user privatebin;
|
||||||
|
worker_processes auto;
|
||||||
|
pid /var/run/nginx.pid;
|
||||||
|
daemon off;
|
||||||
|
|
||||||
|
events {
|
||||||
|
worker_connections 1024;
|
||||||
|
use epoll;
|
||||||
|
}
|
||||||
|
|
||||||
|
http {
|
||||||
|
include /etc/nginx/mime.types;
|
||||||
|
default_type application/octet-stream;
|
||||||
|
|
||||||
|
access_log off;
|
||||||
|
error_log /var/log/nginx/error.log error;
|
||||||
|
|
||||||
|
sendfile on;
|
||||||
|
keepalive_timeout 15;
|
||||||
|
keepalive_disable msie6;
|
||||||
|
keepalive_requests 100;
|
||||||
|
tcp_nopush on;
|
||||||
|
tcp_nodelay off;
|
||||||
|
server_tokens off;
|
||||||
|
|
||||||
|
gzip on;
|
||||||
|
gzip_comp_level 5;
|
||||||
|
gzip_min_length 512;
|
||||||
|
gzip_buffers 4 8k;
|
||||||
|
gzip_proxied any;
|
||||||
|
gzip_vary on;
|
||||||
|
gzip_disable "msie6";
|
||||||
|
gzip_types
|
||||||
|
text/css
|
||||||
|
text/javascript
|
||||||
|
text/xml
|
||||||
|
text/plain
|
||||||
|
text/x-component
|
||||||
|
application/javascript
|
||||||
|
application/x-javascript
|
||||||
|
application/json
|
||||||
|
application/xml
|
||||||
|
application/rss+xml
|
||||||
|
application/vnd.ms-fontobject
|
||||||
|
font/truetype
|
||||||
|
font/opentype
|
||||||
|
image/svg+xml;
|
||||||
|
|
||||||
|
server {
|
||||||
|
listen 80;
|
||||||
|
root /privatebin;
|
||||||
|
index index.php index.html;
|
||||||
|
|
||||||
|
location ~* \.(jpg|jpeg|gif|css|png|js|map|woff|woff2|ttf|svg|eot)$ {
|
||||||
|
expires 30d;
|
||||||
|
access_log off;
|
||||||
|
}
|
||||||
|
|
||||||
|
location ~ ^/(data|cfg|tmp) {
|
||||||
|
deny all;
|
||||||
|
}
|
||||||
|
|
||||||
|
location ~* /(.*)\.(?:markdown|md|twig|yaml|yml|ht|htaccess|ini)$ {
|
||||||
|
deny all;
|
||||||
|
}
|
||||||
|
|
||||||
|
location ~ /\. {
|
||||||
|
deny all;
|
||||||
|
}
|
||||||
|
|
||||||
|
location / {
|
||||||
|
try_files $uri $uri/ /index.php;
|
||||||
|
}
|
||||||
|
|
||||||
|
location ~ \.php$ {
|
||||||
|
fastcgi_index index.php;
|
||||||
|
fastcgi_pass unix:/var/run/php-fpm.sock;
|
||||||
|
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
|
||||||
|
include /etc/nginx/fastcgi_params;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
12
files/php-fpm.conf
Normal file
12
files/php-fpm.conf
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
[www]
|
||||||
|
user = privatebin
|
||||||
|
group = privatebin
|
||||||
|
listen = /var/run/php-fpm.sock
|
||||||
|
listen.owner = privatebin
|
||||||
|
listen.group = privatebin
|
||||||
|
pm = dynamic
|
||||||
|
pm.max_children = 5
|
||||||
|
pm.start_servers = 2
|
||||||
|
pm.min_spare_servers = 1
|
||||||
|
pm.max_spare_servers = 3
|
||||||
|
chdir = /
|
||||||
8
files/supervisord.conf
Normal file
8
files/supervisord.conf
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
[supervisord]
|
||||||
|
nodaemon=true
|
||||||
|
|
||||||
|
[program:php-fpm]
|
||||||
|
command=php-fpm7 --nodaemonize
|
||||||
|
|
||||||
|
[program:nginx]
|
||||||
|
command=nginx
|
||||||
Reference in New Issue
Block a user