mirror of
https://github.com/ajurna/cbwebreader.git
synced 2025-12-06 06:17:17 +00:00
Docker optimisation (#74)
* optimised docker image. * bump version Co-authored-by: Peter Dwyer <peter.dwyer@clanwilliamhealth.com>
This commit is contained in:
32
Dockerfile
32
Dockerfile
@@ -1,38 +1,36 @@
|
||||
FROM python:3
|
||||
FROM python:3.10-slim-bullseye
|
||||
|
||||
ENV PYTHONFAULTHANDLER=1 \
|
||||
PYTHONHASHSEED=random \
|
||||
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 /static
|
||||
|
||||
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/
|
||||
|
||||
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 -r requirements.txt \
|
||||
&& cd frontend \
|
||||
&& npm install \
|
||||
&& npm run build \
|
||||
&& apt remove -y npm software-properties-common \
|
||||
&& rm -r node_modules \
|
||||
&& apt -y auto-remove
|
||||
|
||||
WORKDIR /src
|
||||
&& apt -y auto-remove \
|
||||
&& apt clean \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
RUN cat /src/cbreader/crontab >> /etc/cron.daily/cbreader
|
||||
|
||||
|
||||
Reference in New Issue
Block a user