Skip to content

Commit 9894c4b

Browse files
committed
first save up
0 parents  commit 9894c4b

File tree

13 files changed

+312
-0
lines changed

13 files changed

+312
-0
lines changed

.dockerignore

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
.git
2+
.gitignore
3+
.github
4+
.gitattributes
5+
READMETEMPLATE.md
6+
README.md

.gitattributes

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Auto detect text files and perform LF normalization
2+
* text=auto
3+
4+
# Custom for Visual Studio
5+
*.cs diff=csharp
6+
7+
# Standard to msysgit
8+
*.doc diff=astextplain
9+
*.DOC diff=astextplain
10+
*.docx diff=astextplain
11+
*.DOCX diff=astextplain
12+
*.dot diff=astextplain
13+
*.DOT diff=astextplain
14+
*.pdf diff=astextplain
15+
*.PDF diff=astextplain
16+
*.rtf diff=astextplain
17+
*.RTF diff=astextplain

.github/ISSUE_TEMPLATE.md

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<!--- Provide a general summary of the issue in the Title above -->
2+
3+
[linuxserverurl]: https://linuxserver.io
4+
[![linuxserver.io](https://raw.githubusercontent.com/linuxserver/docker-templates/master/linuxserver.io/img/linuxserver_medium.png)][linuxserverurl]
5+
6+
7+
<!--- If you have an issue with the project, please provide us with the following information -->
8+
9+
<!--- Host OS -->
10+
<!--- Command line users, your run/create command, GUI/Unraid users, a screenshot of your template settings. -->
11+
<!--- Docker log output, docker log <container-name> -->
12+
<!--- Mention if you're using symlinks on any of the volume mounts. -->
13+
14+
15+
<!--- If you have a suggestion or fix for the project, please provide us with the following information -->
16+
17+
<!--- What you think your suggestion brings to the project, or fixes with the project -->
18+
<!--- If it's a fix, would it be better suited as a Pull request to the repo ? -->
19+
20+
## Thanks, team linuxserver.io
21+

.github/PULL_REQUEST_TEMPLATE.md

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<!--- Provide a general summary of your changes in the Title above -->
2+
3+
[linuxserverurl]: https://linuxserver.io
4+
[![linuxserver.io](https://raw.githubusercontent.com/linuxserver/docker-templates/master/linuxserver.io/img/linuxserver_medium.png)][linuxserverurl]
5+
6+
7+
<!--- Before submitting a pull request please check the following -->
8+
9+
<!--- That you have made a branch in your fork, we'd rather not merge from your master -->
10+
<!--- That if the PR is addressing an existing issue include, closes #<issue number> , in the body of the PR commit message -->
11+
<!--- You have included links to any files / patches etc your PR may be using in the body of the PR commit message -->
12+
<!--- -->
13+
14+
## Thanks, team linuxserver.io
15+

.gitignore

+43
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# Windows image file caches
2+
Thumbs.db
3+
ehthumbs.db
4+
5+
# Folder config file
6+
Desktop.ini
7+
8+
# Recycle Bin used on file shares
9+
$RECYCLE.BIN/
10+
11+
# Windows Installer files
12+
*.cab
13+
*.msi
14+
*.msm
15+
*.msp
16+
17+
# Windows shortcuts
18+
*.lnk
19+
20+
# =========================
21+
# Operating System Files
22+
# =========================
23+
24+
# OSX
25+
# =========================
26+
27+
.DS_Store
28+
.AppleDouble
29+
.LSOverride
30+
31+
# Thumbnails
32+
._*
33+
34+
# Files that might appear on external disk
35+
.Spotlight-V100
36+
.Trashes
37+
38+
# Directories potentially created on remote AFP share
39+
.AppleDB
40+
.AppleDesktop
41+
Network Trash Folder
42+
Temporary Items
43+
.apdisk

Dockerfile

+57
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
FROM lsiobase/alpine.nginx:3.5
2+
MAINTAINER sparklyballs
3+
4+
# set version label
5+
ARG BUILD_DATE
6+
ARG VERSION
7+
LABEL build_version="Linuxserver.io version:- ${VERSION} Build-date:- ${BUILD_DATE}"
8+
9+
# install build packages
10+
RUN \
11+
apk add --no-cache --virtual=build-dependencies \
12+
curl \
13+
g++ \
14+
gcc \
15+
git \
16+
make \
17+
python2-dev \
18+
tar && \
19+
20+
# install runtime packages
21+
apk add --no-cache \
22+
py2-lxml \
23+
py2-pip \
24+
python2 && \
25+
26+
# install calibre-web
27+
mkdir -p \
28+
/app/calibre-web && \
29+
curl -o \
30+
/tmp/calibre-web.tar.gz -L \
31+
https://github.com/janeczku/calibre-web/archive/master.tar.gz && \
32+
tar xf \
33+
/tmp/calibre-web.tar.gz -C \
34+
/app/calibre-web --strip-components=1 && \
35+
cd /app/calibre-web && \
36+
pip install --no-cache-dir -U -r \
37+
requirements.txt && \
38+
39+
# install pip packages
40+
pip install --no-cache-dir -U \
41+
gunicorn \
42+
Wand && \
43+
44+
# cleanup
45+
apk del --purge \
46+
build-dependencies && \
47+
rm -rf \
48+
/etc/services.d/php-fpm \
49+
/etc/logrotate.d/php-fpm7 \
50+
/tmp/*
51+
52+
# add local files
53+
COPY root/ /
54+
55+
# ports and volumes
56+
EXPOSE 80
57+
VOLUME /books /config

README.md

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
[linuxserverurl]: https://linuxserver.io
2+
[forumurl]: https://forum.linuxserver.io
3+
[ircurl]: https://www.linuxserver.io/irc/
4+
[podcasturl]: https://www.linuxserver.io/podcast/
5+
6+
[![linuxserver.io](https://raw.githubusercontent.com/linuxserver/docker-templates/master/linuxserver.io/img/linuxserver_medium.png)][linuxserverurl]
7+
8+
## This is a Container in active development by the [LinuxServer.io][linuxserverurl] team and is not recommended for use by the general public.
9+
10+
If you want to comment\contribute on this container , are looking for support on any of our other work , or are curious about us in general, check out the following.
11+
12+
* [forum.linuxserver.io][forumurl]
13+
* [IRC][ircurl] on freenode at `#linuxserver.io`
14+
* [Podcast][podcasturl] covers everything to do with getting the most from your Linux Server plus a focus on all things Docker and containerisation!
15+

READMETEMPLATE.md

+81
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
[linuxserverurl]: https://linuxserver.io
2+
[forumurl]: https://forum.linuxserver.io
3+
[ircurl]: https://www.linuxserver.io/irc/
4+
[podcasturl]: https://www.linuxserver.io/podcast/
5+
[appurl]: www.example.com
6+
[hub]: https://hub.docker.com/r/example/example/
7+
8+
[![linuxserver.io](https://raw.githubusercontent.com/linuxserver/docker-templates/master/linuxserver.io/img/linuxserver_medium.png)][linuxserverurl]
9+
10+
The [LinuxServer.io][linuxserverurl] team brings you another container release featuring easy user mapping and community support. Find us for support at:
11+
* [forum.linuxserver.io][forumurl]
12+
* [IRC][ircurl] on freenode at `#linuxserver.io`
13+
* [Podcast][podcasturl] covers everything to do with getting the most from your Linux Server plus a focus on all things Docker and containerisation!
14+
15+
# <image-name>
16+
17+
Provide a short, concise description of the application. No more than two SHORT paragraphs. Link to sources where possible and include an image illustrating your point if necessary. Point users to the original applications website, as that's the best place to get support - not here.
18+
19+
Our Plex container has immaculate docs so follow that if in doubt for layout.
20+
21+
`IMPORTANT, replace all instances of <image-name> with the correct dockerhub repo (ie linuxserver/plex) and <container-name> information (ie, plex)`
22+
23+
## Usage
24+
25+
```
26+
docker create \
27+
--name=<container-name> \
28+
-v <path to data>:/config \
29+
-e PGID=<gid> -e PUID=<uid> \
30+
-p 1234:1234 \
31+
<image-name>
32+
```
33+
34+
## Parameters
35+
36+
`The parameters are split into two halves, separated by a colon, the left hand side representing the host and the right the container side.
37+
For example with a port -p external:internal - what this shows is the port mapping from internal to external of the container.
38+
So -p 8080:80 would expose port 80 from inside the container to be accessible from the host's IP on port 8080
39+
http://192.168.x.x:8080 would show you what's running INSIDE the container on port 80.`
40+
41+
42+
43+
* `-p 1234` - the port(s)
44+
* `-v /config` - explain what lives here
45+
* `-e PGID` for GroupID - see below for explanation
46+
* `-e PUID` for UserID - see below for explanation
47+
48+
It is based on alpine linux with s6 overlay, for shell access whilst the container is running do `docker exec -it <container-name> /bin/bash`.
49+
50+
### User / Group Identifiers
51+
52+
Sometimes when using data volumes (`-v` flags) permissions issues can arise between the host OS and the container. We avoid this issue by allowing you to specify the user `PUID` and group `PGID`. Ensure the data volume directory on the host is owned by the same user you specify and it will "just work" ™.
53+
54+
In this instance `PUID=1001` and `PGID=1001`. To find yours use `id user` as below:
55+
56+
```
57+
$ id <dockeruser>
58+
uid=1001(dockeruser) gid=1001(dockergroup) groups=1001(dockergroup)
59+
```
60+
61+
## Setting up the application
62+
63+
Insert a basic user guide here to get a n00b up and running with the software inside the container. DELETE ME
64+
65+
66+
## Info
67+
68+
* Shell access whilst the container is running: `docker exec -it <container-name> /bin/bash`
69+
* To monitor the logs of the container in realtime: `docker logs -f <container-name>`
70+
71+
* container version number
72+
73+
`docker inspect -f '{{ index .Config.Labels "build_version" }}' <container-name>`
74+
75+
* image version number
76+
77+
`docker inspect -f '{{ index .Config.Labels "build_version" }}' <image-name>`
78+
79+
## Versions
80+
81+
+ **dd.MM.yy:** This is the standard Version type now.

root/defaults/default

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
upstream wsgi-server {
2+
server 127.0.0.1:8083;
3+
}
4+
5+
server {
6+
listen 80 default_server;
7+
root /config/www;
8+
index index.html;
9+
10+
# Serve static files
11+
location ^~ /static/ {
12+
root /app/calibre-web/cps/;
13+
}
14+
15+
# Proxy connections to the application server
16+
location / {
17+
proxy_pass http://wsgi-server;
18+
proxy_redirect off;
19+
proxy_set_header Host $http_host;
20+
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
21+
proxy_set_header X-Scheme $scheme;
22+
proxy_set_header X-Forwarded-Host $server_name;
23+
proxy_set_header X-Real-IP $remote_addr;
24+
25+
}
26+
}

root/defaults/gunicorn.conf.py

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import os
2+
3+
workers = 1
4+
bind = "127.0.0.1:8083"
5+
user = 'abc'
6+
loglevel = 'info'

root/defaults/wsgi.py

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import os
2+
import sys
3+
4+
base_path = os.path.dirname(os.path.abspath(__file__))
5+
sys.path.append(os.path.join(base_path, 'vendor'))
6+
from cps import web

root/etc/cont-init.d/30-config

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#!/usr/bin/with-contenv bash
2+
3+
# copy config
4+
[[ ! -e /app/calibre-web/gunicorn.conf.py ]] && \
5+
cp /defaults/gunicorn.conf.py /app/calibre-web/gunicorn.conf.py
6+
7+
[[ ! -e /app/calibre-web/wsgi.py ]] && \
8+
cp /defaults/wsgi.py /app/calibre-web/wsgi.py
9+
10+
# permissions
11+
chown -R abc:abc \
12+
/app/calibre-web

root/etc/services.d/calibre-web/run

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/usr/bin/with-contenv bash
2+
3+
cd /app/calibre-web || exit
4+
5+
exec \
6+
s6-setuidgid abc /usr/bin/gunicorn \
7+
-c /app/calibre-web/gunicorn.conf.py wsgi:web.app

0 commit comments

Comments
 (0)