9 Commits

Author SHA1 Message Date
f7093e5e58 added calibre dir 2021-02-15 11:48:22 +01:00
19c5b0830a remove settings from gitignore 2021-02-15 11:46:49 +01:00
23c1ff7140 no more .bak settings 2021-02-15 11:43:39 +01:00
8187817752 even more fixes 2021-02-15 11:42:40 +01:00
9160a37378 more fixes 2021-02-15 11:41:31 +01:00
fd77792688 fixes 2021-02-15 11:39:49 +01:00
9f5e2e93dd slight fixes to file structure in dockerfile 2021-02-15 11:38:04 +01:00
3a2a2ce268 updates 2021-02-15 11:35:11 +01:00
48443d9855 initial commit 2021-02-15 11:13:30 +01:00
7 changed files with 83 additions and 4 deletions

2
.gitignore vendored
View File

@@ -1,5 +1,5 @@
# project specific # project specific
settings.json #settings.json
db.sqlite3 db.sqlite3
dummyusers.json dummyusers.json
*.prof *.prof

View File

@@ -0,0 +1,20 @@
[uwsgi]
base = /cwebcomp
chdir = %(base)
home = %(base)
pidfile= %(base)/cwebcomp.pid
pythonpath= /usr/local
uid = www-data
gid = www-data
module = wsgi:application # path to wsgy.py file
socket = :8000
processes = 8
threads = 4
master = true
chmod-socket = 660
vacuum = true
die-on-term = true
harakiri = 20
max-requests = 5000
logs = %(base)/uwsgi_info.logs
daemonize = %(base)/uwsgi.logs

View File

@@ -1,5 +1,5 @@
{ {
"CALIBRE_DIR": "/usr/src/app/calibredir", "CALIBRE_DIR": "calibre",
"SECRET_KEY": "u(8^+rb%rz5hsx4v^^y(ul7g(4n7a8!db@s*9(m5cs*2_ppy8+", "SECRET_KEY": "u(8^+rb%rz5hsx4v^^y(ul7g(4n7a8!db@s*9(m5cs*2_ppy8+",
"ALLOWED_HOSTS": [ "ALLOWED_HOSTS": [
"127.0.0.1" "127.0.0.1"

35
Dockerfile Normal file
View File

@@ -0,0 +1,35 @@
FROM python:3.9.1-slim-buster
RUN apt-get clean && \
apt-get update && \
apt-get install -y nginx smbclient default-libmysqlclient-dev \
gcc python3-cffi libcairo2 libpango-1.0-0 libpangocairo-1.0-0 \
libgdk-pixbuf2.0-0 libffi-dev shared-mime-info
# set environment variables
ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1
RUN mkdir /cwebcomp
WORKDIR /cwebcomp
ADD . /cwebcomp/
# only add this next one if you have static files
RUN mkdir static
RUN pip install -r requirements.txt
RUN python CalibreWebCompanion/manage.py collectstatic
# only if you need celery
#RUN useradd -ms /bin/bash celery
#COPY broker/init.d_celeryd /etc/init.d/celeryd
#COPY broker/celeryd /etc/default/celeryd
# nginx config and script to be run
COPY deployment/docker/nginx.conf /etc/nginx/sites-available/default
COPY deployment/docker/start.sh /usr/local/bin/start.sh
# set proper file permissions
RUN chmod u+x /usr/local/bin/start.sh
EXPOSE 80
CMD ["/bin/bash", "-c", "start.sh"]

View File

@@ -1,6 +1,6 @@
## pull official base image ## pull official base image
FROM python:3.8.3-alpine FROM python:slim-buster
EXPOSE 8080 EXPOSE 8080
## set work directory ## set work directory
WORKDIR /usr/src/app WORKDIR /usr/src/app
@@ -17,7 +17,7 @@ COPY ./deployment/nginx.conf /etc/nginx/
## copy project ## copy project
COPY ./CalibreWebCompanion ./CalibreWebCompanion COPY ./CalibreWebCompanion ./CalibreWebCompanion
copy ./deployment/startupscript.py ./ COPY ./deployment/startupscript.py ./
## gunicorn borks started with supervisord ## gunicorn borks started with supervisord
COPY ./deployment/supervisord.conf /etc/ COPY ./deployment/supervisord.conf /etc/
ENTRYPOINT /usr/bin/supervisord -c /etc/supervisord.conf ENTRYPOINT /usr/bin/supervisord -c /etc/supervisord.conf

View File

@@ -0,0 +1,20 @@
server {
listen 80;
server_name 127.0.0.1;
charset utf-8;
client_max_body_size 75M;
location /static/ {
alias /cwebcomp/static/;
}
location /media/ {
alias /cwebcomp/media/;
}
location / {
include uwsgi_params;
uwsgi_pass 127.0.0.1:8000;
}
}

View File

@@ -0,0 +1,4 @@
#!/bin/bash
uwsgi --ini app.ini --venv /usr/local
nginx -g 'daemon off;'