mirror of
https://github.com/ajurna/cbwebreader.git
synced 2025-12-06 14:17:19 +00:00
Docker optimisation (#74)
* optimised docker image. * bump version Co-authored-by: Peter Dwyer <peter.dwyer@clanwilliamhealth.com>
This commit is contained in:
@@ -1,8 +1,6 @@
|
|||||||
# Dockerignore whitelist
|
# Dockerignore whitelist
|
||||||
*
|
*
|
||||||
|
|
||||||
!Pipfile
|
|
||||||
!Pipfile.lock
|
|
||||||
!cbreader
|
!cbreader
|
||||||
!comic
|
!comic
|
||||||
!comic_auth
|
!comic_auth
|
||||||
@@ -16,3 +14,5 @@
|
|||||||
!package-lock.json
|
!package-lock.json
|
||||||
!package.json
|
!package.json
|
||||||
!frontend
|
!frontend
|
||||||
|
/frontend/node_modules
|
||||||
|
/frontend/dist
|
||||||
32
Dockerfile
32
Dockerfile
@@ -1,38 +1,36 @@
|
|||||||
FROM python:3
|
FROM python:3.10-slim-bullseye
|
||||||
|
|
||||||
ENV PYTHONFAULTHANDLER=1 \
|
ENV PYTHONFAULTHANDLER=1 \
|
||||||
PYTHONHASHSEED=random \
|
PYTHONHASHSEED=random \
|
||||||
PYTHONUNBUFFERED=1 \
|
PYTHONUNBUFFERED=1 \
|
||||||
PYTHONDONTWRITEBYTECODE=1
|
PYTHONDONTWRITEBYTECODE=1 \
|
||||||
|
PIP_DEFAULT_TIMEOUT=100 \
|
||||||
|
PIP_DISABLE_PIP_VERSION_CHECK=1 \
|
||||||
|
PIP_NO_CACHE_DIR=1
|
||||||
|
|
||||||
RUN mkdir /src
|
RUN mkdir /src
|
||||||
RUN mkdir /static
|
RUN mkdir /static
|
||||||
|
|
||||||
WORKDIR /src
|
WORKDIR /src
|
||||||
|
|
||||||
ENV PIP_DEFAULT_TIMEOUT=100 \
|
|
||||||
PIP_DISABLE_PIP_VERSION_CHECK=1 \
|
|
||||||
PIP_NO_CACHE_DIR=1
|
|
||||||
|
|
||||||
RUN apt update
|
|
||||||
RUN apt install -y software-properties-common
|
|
||||||
RUN apt-add-repository non-free
|
|
||||||
RUN apt update
|
|
||||||
|
|
||||||
COPY requirements.txt /src
|
|
||||||
|
|
||||||
COPY . /src/
|
COPY . /src/
|
||||||
|
|
||||||
RUN apt install -y npm cron unrar \
|
|
||||||
|
RUN apt update \
|
||||||
|
&& apt install -y software-properties-common \
|
||||||
|
&& apt-add-repository non-free \
|
||||||
|
&& apt update \
|
||||||
|
&& apt install -y npm cron unrar libmariadb-dev libpq-dev \
|
||||||
&& pip install --upgrade pip \
|
&& pip install --upgrade pip \
|
||||||
&& pip install -r requirements.txt \
|
&& pip install -r requirements.txt \
|
||||||
&& cd frontend \
|
&& cd frontend \
|
||||||
&& npm install \
|
&& npm install \
|
||||||
&& npm run build \
|
&& npm run build \
|
||||||
|
&& apt remove -y npm software-properties-common \
|
||||||
&& rm -r node_modules \
|
&& rm -r node_modules \
|
||||||
&& apt -y auto-remove
|
&& apt -y auto-remove \
|
||||||
|
&& apt clean \
|
||||||
WORKDIR /src
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
RUN cat /src/cbreader/crontab >> /etc/cron.daily/cbreader
|
RUN cat /src/cbreader/crontab >> /etc/cron.daily/cbreader
|
||||||
|
|
||||||
|
|||||||
@@ -117,7 +117,7 @@ LOGIN_URL = "/login/"
|
|||||||
UNRAR_TOOL = os.getenv("DJANGO_UNRAR_TOOL", None)
|
UNRAR_TOOL = os.getenv("DJANGO_UNRAR_TOOL", None)
|
||||||
|
|
||||||
|
|
||||||
COMIC_BOOK_VOLUME = Path(os.getenv("COMIC_BOOK_VOLUME"))
|
COMIC_BOOK_VOLUME = Path(os.getenv("COMIC_BOOK_VOLUME", '/comics'))
|
||||||
|
|
||||||
from .logger import LOGGING
|
from .logger import LOGGING
|
||||||
|
|
||||||
@@ -185,13 +185,12 @@ SIMPLE_JWT = {
|
|||||||
'LEEWAY': timedelta(minutes=5),
|
'LEEWAY': timedelta(minutes=5),
|
||||||
}
|
}
|
||||||
|
|
||||||
TEMPLATES_DIR = os.path.join(BASE_DIR, 'templates')
|
|
||||||
FRONTEND_DIR = os.path.join(BASE_DIR, 'frontend')
|
FRONTEND_DIR = os.path.join(BASE_DIR, 'frontend')
|
||||||
|
|
||||||
TEMPLATES = [
|
TEMPLATES = [
|
||||||
{
|
{
|
||||||
"BACKEND": "django.template.backends.django.DjangoTemplates",
|
"BACKEND": "django.template.backends.django.DjangoTemplates",
|
||||||
"DIRS": [TEMPLATES_DIR, ],
|
"DIRS": [],
|
||||||
"APP_DIRS": True,
|
"APP_DIRS": True,
|
||||||
"OPTIONS": {
|
"OPTIONS": {
|
||||||
"context_processors": [
|
"context_processors": [
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ services:
|
|||||||
# command: /bin/bash entrypoint-cron.sh
|
# command: /bin/bash entrypoint-cron.sh
|
||||||
|
|
||||||
database:
|
database:
|
||||||
image: postgres:11.4-alpine
|
image: postgres:14-alpine
|
||||||
expose:
|
expose:
|
||||||
- 5432
|
- 5432
|
||||||
volumes:
|
volumes:
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ line_length = 119
|
|||||||
|
|
||||||
[tool.poetry]
|
[tool.poetry]
|
||||||
name = "cbwebreader"
|
name = "cbwebreader"
|
||||||
version = "1.0.1"
|
version = "1.0.2"
|
||||||
description = "CBR/Z Web Reader"
|
description = "CBR/Z Web Reader"
|
||||||
authors = ["ajurna <ajurna@gmail.com>"]
|
authors = ["ajurna <ajurna@gmail.com>"]
|
||||||
license = "Creative Commons Attribution-ShareAlike 4.0 International License"
|
license = "Creative Commons Attribution-ShareAlike 4.0 International License"
|
||||||
|
|||||||
Reference in New Issue
Block a user