Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added ubuntu 20.04 support + fixed minor font issue. #91

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions release/ubuntu20.04/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
FROM ubuntu:focal
MAINTAINER p0rc0_r0ss0 <https://github.com/p0rc0jet>

ENV LC_ALL="C.UTF-8" LANG="C.UTF-8" DEBIAN_FRONTEND=noninteractive

RUN echo 'apt::install-recommends "false";' > /etc/apt/apt.conf.d/00recommends \
&& apt update && apt upgrade -y \
&& apt install -y --no-install-recommends gnupg apt-transport-https curl wget ca-certificates file \
&& echo "deb https://zmrepo.zoneminder.com/debian/master focal/" > /etc/apt/sources.list.d/zm_focal.list \
&& wget -O - https://zmrepo.zoneminder.com/debian/archive-keyring.gpg | apt-key add - \
&& apt update \
&& apt install -y zoneminder apache2 libapache2-mod-php \
&& a2enconf zoneminder \
&& a2enmod rewrite cgi

VOLUME /var/cache/zoneminder/events /var/cache/zoneminder/images /var/lib/mysql /var/log/zm
EXPOSE 80

COPY patch/skin.css /usr/share/zoneminder/www/skins/classic/css/base/
COPY utils/entrypoint.sh /usr/local/bin/
RUN chmod 755 /usr/local/bin/entrypoint.sh
ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]
83 changes: 83 additions & 0 deletions release/ubuntu20.04/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
# Zoneminder
Based on ubuntu:focal minimal image. Only vital packages and dependencies added (which still grew package from 77MB to 700+MB).

## Release notes
- Added patched `skin.css` to get rid of "font not found" problem for good.
- Release is intended to work with external MySQL only no internal MySQL server installed.
- Dockerfile has been optimized to reduce number of container layers.
- Version deployed through `docker-compose` exposes port 80 and can work standalone or with nginx reverse proxy.

### A drop of lyrics
I've been using Zoneminder for a long time and came up with conclusion that it is better to have separate mysql server for it. Because of this there is separate mysql container with no ports exposed outside, just to own network.

## Getting started
Can be deployed in few easy steps

### Build
Yeah, manual labour :)
```bash
mkdir -p /usr/src/zm_focal/patch
wget https://raw.githubusercontent.com/p0rc0jet/zmdockerfiles/master/release/ubuntu20.04/patch/skin.css -P /usr/src/zm_focal/patch
wget https://raw.githubusercontent.com/p0rc0jet/zmdockerfiles/master/release/ubuntu20.04/Dockerfile -P /usr/src/zm_focal
cd /usr/src/zm_focal
docker build /usr/src/zm_focal -f Dockerfile -t zm_focal_min
```
On success go to next step.

### Compose and up
I'll assume that MySQL container is up and running with name `zm_db`.

#### docker-compose.yml
```yaml
version: '3.5'

services:

zm_focal:
image: zm_focal_min
container_name: zm_focal
#restart: unless-stopped
env_file:
- zm.env
volumes:
- /mnt/zm/zoneminder:/var/cache/zoneminder:rw
- /mnt/zm/logs:/var/log/zm
- /mnt/zm/logs:/var/log/zoneminder
- /dev/dri:/dev/dri
shm_size: "512mb"
privileged: false
environment:
- TZ=<your_time_zone_here>
- PUID=99
- PGID=100
- MULTI_PORT_START=0
- MULTI_PORT_END=0
- VIRTUAL_HOST=zm.domain.local
ports:
- "80:80"
networks:
- zm

networks:
zm:
name: zm
driver: bridge
```

#### zm.env
```bash
ZM_DB_USER=zm
ZM_DB_PASS=this_is_one_long_password_here
ZM_DB_NAME=zm
ZM_DB_HOST=zm_db
```

Finally
```bash
docker-compose up -d
```

### Connect
`http://<your ip or hostname>/zm`


Loading