add a gitignore, add some more important things to gitignore, make it so setup_venv.sh works on future Debian versions, add Dockerfile and lighttpd.conf file for running a news server in a container
This commit is contained in:
6
.gitignore
vendored
Normal file
6
.gitignore
vendored
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
^build
|
||||||
|
^env
|
||||||
|
^etc/.*.custom
|
||||||
|
# Accidentally checking in a working transifexrc would be extremely bad!
|
||||||
|
.transifexrc
|
||||||
|
^logs
|
@ -1,3 +1,6 @@
|
|||||||
^build
|
^build
|
||||||
^env
|
^env
|
||||||
^etc/.*.custom
|
^etc/.*.custom
|
||||||
|
# Accidentally checking in a working transifexrc would be extremely bad!
|
||||||
|
.transifexrc
|
||||||
|
^logs
|
||||||
|
9
Dockerfile
Normal file
9
Dockerfile
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
FROM alpine
|
||||||
|
RUN apk update
|
||||||
|
RUN apk add lighttpd
|
||||||
|
COPY build /var/www/localhost/htdocs/news
|
||||||
|
COPY lighttpd.docker.conf /etc/lighttpd/lighttpd.conf
|
||||||
|
RUN mkdir -p /run/lighttpd/ && \
|
||||||
|
chown -R lighttpd /run/lighttpd
|
||||||
|
USER lighttpd
|
||||||
|
CMD lighttpd -f /etc/lighttpd/lighttpd.conf -D
|
52
lighttpd.docker.conf
Normal file
52
lighttpd.docker.conf
Normal file
@ -0,0 +1,52 @@
|
|||||||
|
|
||||||
|
var.basedir = "/var/www/localhost"
|
||||||
|
var.logdir = "/var/log/lighttpd"
|
||||||
|
var.statedir = "/var/lib/lighttpd"
|
||||||
|
|
||||||
|
server.port = 3000
|
||||||
|
|
||||||
|
server.modules = (
|
||||||
|
"mod_rewrite",
|
||||||
|
"mod_access",
|
||||||
|
"mod_accesslog"
|
||||||
|
)
|
||||||
|
|
||||||
|
#include "mime-types.conf"
|
||||||
|
|
||||||
|
|
||||||
|
mimetype.assign += ( ".su3" => "application/octet-stream",
|
||||||
|
".xml" => "text/xml",
|
||||||
|
".html" => "text/html",
|
||||||
|
".txt" => "text/plain", )
|
||||||
|
|
||||||
|
server.username = "lighttpd"
|
||||||
|
server.groupname = "lighttpd"
|
||||||
|
|
||||||
|
server.document-root = var.basedir + "/htdocs"
|
||||||
|
server.pid-file = "/run/lighttpd/lighttpd.pid"
|
||||||
|
|
||||||
|
server.errorlog = var.logdir + "/error.log"
|
||||||
|
|
||||||
|
server.indexfiles = ("index.php", "index.html",
|
||||||
|
"index.htm", "default.htm")
|
||||||
|
server.follow-symlink = "enable"
|
||||||
|
|
||||||
|
static-file.exclude-extensions = (".php", ".pl", ".cgi", ".fcgi")
|
||||||
|
|
||||||
|
accesslog.filename = var.logdir + "/access.log"
|
||||||
|
|
||||||
|
dir-listing.activate = "enable"
|
||||||
|
|
||||||
|
url.access-deny = ("~", ".inc")
|
||||||
|
|
||||||
|
url.rewrite-repeat = (
|
||||||
|
"^/news/news.atom.xml\?lang=([a-z]+(_[A-Za-z]+)?)" => "/news/news_$1.atom.xml",
|
||||||
|
"^/news/news.su3\?lang=([a-z]+(_[A-Za-z]+)?)" => "/news/news_$1.su3",
|
||||||
|
)
|
||||||
|
|
||||||
|
url.rewrite-repeat-if-not-file = (
|
||||||
|
"^/news/news_([a-z]+)_[A-Za-z]+.atom.xml" => "/news/news_$1.atom.xml",
|
||||||
|
"^/news/news_([a-z]+)_[A-Za-z]+.su3" => "/news/news_$1.su3",
|
||||||
|
"^/news/news_[a-z]+.atom.xml" => "/news/news.atom.xml",
|
||||||
|
"^/news/news_[a-z]+.su3" => "/news/news.su3",
|
||||||
|
)
|
@ -7,7 +7,11 @@ if [ ! $venv ]; then
|
|||||||
exit 1
|
exit 1
|
||||||
else
|
else
|
||||||
if [ ! -d $venv_dir ] ; then
|
if [ ! -d $venv_dir ] ; then
|
||||||
$venv --distribute $venv_dir
|
if $venv --version | grep '[2-9][0-9].0.*'; then
|
||||||
|
$venv $venv_dir
|
||||||
|
else
|
||||||
|
$venv --distribute $venv_dir
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
. $venv_dir/bin/activate
|
. $venv_dir/bin/activate
|
||||||
|
Reference in New Issue
Block a user