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

Update Dockerfile (major) #21

Open
wants to merge 166 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
166 commits
Select commit Hold shift + click to select a range
62df644
Update Dockerfile (major)
curtishall Jul 16, 2023
baf3493
Update Dockerfile
curtishall Jul 16, 2023
0ae85ec
Update Dockerfile
curtishall Jul 16, 2023
bfe5629
Update Dockerfile
curtishall Jul 16, 2023
ef8e88f
Update Dockerfile
curtishall Jul 16, 2023
eafe678
Update Dockerfile
curtishall Jul 16, 2023
d217815
Update Dockerfile
curtishall Jul 16, 2023
642a753
Update Dockerfile
curtishall Jul 16, 2023
bb8f4a6
Update Dockerfile
curtishall Jul 16, 2023
e1f8d2a
Update Dockerfile
curtishall Jul 16, 2023
42c032b
Update Dockerfile
curtishall Jul 17, 2023
3952a27
Update docker-publish.yml
curtishall Jul 17, 2023
92b8acf
Update docker-publish.yml
curtishall Jul 17, 2023
aac0728
Update docker-publish.yml
curtishall Jul 17, 2023
f928196
Update Dockerfile
curtishall Jul 17, 2023
842528e
Update docker-publish.yml
curtishall Jul 17, 2023
7dbd035
Update docker-publish.yml
curtishall Jul 17, 2023
082cf89
Update docker-publish.yml
curtishall Jul 17, 2023
c5d065a
Update docker-publish.yml
curtishall Jul 17, 2023
62cf4f0
Update docker-publish.yml
curtishall Jul 17, 2023
600eea3
Update docker-publish.yml
curtishall Jul 17, 2023
c76ae23
Update docker-publish.yml
curtishall Jul 17, 2023
806f340
Update docker-publish.yml
curtishall Jul 17, 2023
52f8716
Update docker-publish.yml
curtishall Jul 18, 2023
f448c0d
Update docker-publish.yml
curtishall Jul 18, 2023
6142a00
Update docker-publish.yml
curtishall Jul 18, 2023
b2a18f3
Update docker-publish.yml
curtishall Jul 18, 2023
2be2ad5
Update docker-publish.yml
curtishall Jul 18, 2023
ca68323
Update docker-publish.yml
curtishall Jul 18, 2023
676e493
Update docker-publish.yml
curtishall Jul 18, 2023
1e13c53
Update docker-publish.yml
curtishall Jul 18, 2023
da0186e
Update docker-publish.yml
curtishall Jul 18, 2023
d173658
Update docker-publish.yml
curtishall Jul 18, 2023
3cfa08b
Update docker-publish.yml
curtishall Jul 18, 2023
eafb61a
Update docker-publish.yml
curtishall Jul 20, 2023
b07df0b
Update docker-publish.yml
curtishall Jul 20, 2023
fda58ab
Update docker-publish.yml
curtishall Jul 20, 2023
c07b4b6
Update Dockerfile
curtishall Jul 20, 2023
a5e39c3
Update docker-publish.yml
curtishall Jul 20, 2023
f8eba18
Update Dockerfile
curtishall Jul 20, 2023
8b69548
Update Dockerfile
curtishall Jul 20, 2023
0fe279b
Update Dockerfile
curtishall Jul 20, 2023
210fb70
Update Dockerfile
curtishall Jul 20, 2023
df5607f
Update Dockerfile
curtishall Jul 20, 2023
d2566d4
Update docker-publish.yml
curtishall Jul 20, 2023
7e422f1
Update docker-publish.yml
curtishall Jul 20, 2023
3280991
Update docker-publish.yml
curtishall Jul 20, 2023
c6e97f5
Update docker-publish.yml
curtishall Jul 20, 2023
69e21c8
Update docker-publish.yml
curtishall Jul 20, 2023
2bde0d8
Update docker-publish.yml
curtishall Jul 20, 2023
46919f6
Update Dockerfile
curtishall Jul 20, 2023
2e41e41
Update docker-publish.yml
curtishall Jul 20, 2023
be26164
Update Dockerfile
curtishall Jul 20, 2023
4d022c3
Update docker-publish.yml
curtishall Jul 20, 2023
3091c45
Update docker-publish.yml
curtishall Jul 20, 2023
8d7af1d
Update docker-publish.yml
curtishall Jul 20, 2023
ebafc28
Update docker-publish.yml
curtishall Jul 20, 2023
e9076e6
Update docker-publish.yml
curtishall Jul 20, 2023
3a11ead
Update Dockerfile
curtishall Jul 20, 2023
1f3030e
Update docker-publish.yml
curtishall Jul 21, 2023
54507d7
Update Dockerfile
curtishall Jul 21, 2023
1b6de52
Update docker-publish.yml
curtishall Jul 21, 2023
5e33d30
Update Dockerfile
curtishall Jul 21, 2023
b546359
Update docker-publish.yml
curtishall Jul 21, 2023
9ce11d1
Update docker-publish.yml
curtishall Jul 21, 2023
93e1184
Update docker-publish.yml
curtishall Jul 21, 2023
444694a
Update docker-publish.yml
curtishall Jul 21, 2023
0a26a58
Update docker-publish.yml
curtishall Jul 21, 2023
f16d757
Update Dockerfile
curtishall Jul 21, 2023
00a9b0f
Update docker-publish.yml
curtishall Jul 21, 2023
979bb10
Update docker-publish.yml
curtishall Jul 21, 2023
0e5f73f
Update docker-publish.yml
curtishall Jul 21, 2023
d81a6f8
Update docker-publish.yml
curtishall Jul 21, 2023
32deaf7
Update docker-publish.yml
curtishall Jul 21, 2023
a180b02
Update docker-publish.yml
curtishall Jul 21, 2023
c3a0c1c
Update docker-publish.yml
curtishall Jul 21, 2023
1bfa24e
Update docker-publish.yml
curtishall Jul 21, 2023
1b35f58
Update docker-publish.yml
curtishall Jul 21, 2023
ea23c40
Update docker-publish.yml
curtishall Jul 21, 2023
c8ecc21
Update Dockerfile
curtishall Jul 21, 2023
42a9b21
Update Dockerfile
curtishall Jul 21, 2023
f2a1add
Update Dockerfile
curtishall Jul 21, 2023
773c995
Create docker-compose.yml
curtishall Jul 22, 2023
1b79e12
Update docker-publish.yml
curtishall Jul 22, 2023
f84574b
Update docker-publish.yml
curtishall Jul 22, 2023
dbe8e19
Update docker-publish.yml
curtishall Jul 22, 2023
f890957
Update docker-publish.yml
curtishall Jul 22, 2023
fd1a16a
Update docker-publish.yml
curtishall Jul 22, 2023
7ac8a99
Update docker-compose.yml
curtishall Jul 22, 2023
f73b31f
Update docker-publish.yml
curtishall Jul 22, 2023
5d0f461
Update docker-publish.yml
curtishall Jul 22, 2023
fee064d
Update docker-publish.yml
curtishall Jul 22, 2023
d6704c5
Update docker-publish.yml
curtishall Jul 22, 2023
d6be887
Update docker-compose.yml
curtishall Jul 22, 2023
67b0094
Update docker-compose.yml
curtishall Jul 22, 2023
d3cfc7c
Update docker-compose.yml
curtishall Jul 22, 2023
eb8983a
Update docker-compose.yml
curtishall Jul 22, 2023
954156b
Update docker-compose.yml
curtishall Jul 22, 2023
14ffef4
Update docker-compose.yml
curtishall Jul 22, 2023
ce21931
Update Dockerfile
curtishall Jul 22, 2023
38beb4a
Update Dockerfile
curtishall Jul 22, 2023
aeb1a03
Update Dockerfile
curtishall Jul 22, 2023
ee8320d
Update Dockerfile
curtishall Jul 22, 2023
2f7611a
Update Dockerfile
curtishall Jul 22, 2023
0da03ab
Update docker-publish.yml
curtishall Jul 22, 2023
4f10c2e
Update Dockerfile
curtishall Jul 22, 2023
aa5978d
Update Dockerfile
curtishall Jul 22, 2023
9330982
Update docker-publish.yml
curtishall Jul 22, 2023
6be5bcb
Update Dockerfile
curtishall Jul 22, 2023
063f005
Update docker-compose.yml
curtishall Jul 22, 2023
4345c08
Update docker-compose.yml
curtishall Jul 22, 2023
85a01dd
Update Dockerfile
curtishall Jul 22, 2023
5abf0f1
Update docker-compose.yml
curtishall Jul 22, 2023
8b20edf
Update docker-compose.yml
curtishall Jul 22, 2023
43fe439
Update docker-compose.yml
curtishall Jul 22, 2023
d9a1ddb
Update docker-compose.yml
curtishall Jul 22, 2023
00f8b7a
Update docker-compose.yml
curtishall Jul 22, 2023
ca8a256
Update docker-compose.yml
curtishall Jul 22, 2023
6fa427b
Update docker-compose.yml
curtishall Jul 22, 2023
f297afa
Update docker-compose.yml
curtishall Jul 22, 2023
1c9f4df
Update docker-compose.yml
curtishall Jul 22, 2023
3bd6cbd
Update docker-compose.yml
curtishall Jul 22, 2023
5cc5285
Update docker-compose.yml
curtishall Jul 22, 2023
1b2ecf2
Update docker-compose.yml
curtishall Jul 22, 2023
56030b1
Update docker-compose.yml
curtishall Jul 22, 2023
ed184e6
Update docker-publish.yml
curtishall Jul 22, 2023
012fa45
Update docker-publish.yml
curtishall Jul 22, 2023
1d6276c
Update docker-publish.yml
curtishall Jul 22, 2023
b316194
Update docker-compose.yml
curtishall Jul 22, 2023
e39eda1
Update docker-compose.yml
curtishall Jul 22, 2023
35d7190
Update docker-compose.yml
curtishall Jul 22, 2023
ad79698
Update docker-compose.yml
curtishall Jul 22, 2023
d11bd5b
Update docker-compose.yml
curtishall Jul 22, 2023
e790233
Update docker-compose.yml
curtishall Jul 22, 2023
0bd450f
Update docker-compose.yml
curtishall Jul 23, 2023
163ced2
Update docker-compose.yml
curtishall Jul 23, 2023
fd6a138
Update docker-compose.yml
curtishall Jul 23, 2023
b4e72e0
Update Dockerfile
curtishall Jul 23, 2023
3791c10
Update Dockerfile
curtishall Jul 23, 2023
f0cc82a
Update docker-compose.yml
curtishall Jul 23, 2023
95863d2
Update docker-publish.yml
curtishall Jul 23, 2023
37b0365
Update docker-publish.yml
curtishall Jul 23, 2023
fe90f11
Update docker-publish.yml
curtishall Jul 23, 2023
9aae4a6
Update docker-publish.yml
curtishall Jul 23, 2023
825fede
Update Dockerfile
curtishall Jul 23, 2023
61ef63e
Update Dockerfile
curtishall Jul 23, 2023
b4cf558
Update Dockerfile
curtishall Jul 23, 2023
3c44e32
Update Dockerfile
curtishall Jul 23, 2023
0f6279a
Update docker-publish.yml
curtishall Jul 23, 2023
4c64599
Update docker-publish.yml
curtishall Jul 23, 2023
4b8084f
Update docker-publish.yml
curtishall Jul 23, 2023
5dfd702
Update docker-publish.yml
curtishall Jul 23, 2023
4f50755
Update docker-publish.yml
curtishall Jul 23, 2023
d82e53d
Update docker-publish.yml
curtishall Jul 23, 2023
322de20
Update docker-publish.yml
curtishall Jul 23, 2023
2f22088
Update docker-publish.yml
curtishall Jul 23, 2023
464dc19
Update docker-publish.yml
curtishall Jul 23, 2023
9518032
Update docker-publish.yml
curtishall Jul 23, 2023
a958a5f
Update docker-publish.yml
curtishall Jul 23, 2023
c8ead29
Update docker-publish.yml
curtishall Jul 23, 2023
4ef8ca7
Update docker-publish.yml
curtishall Jul 23, 2023
50d62db
Update docker-publish.yml
curtishall Jul 23, 2023
45951e3
Update docker-publish.yml
curtishall Jul 23, 2023
2f4018e
Update docker-publish.yml
curtishall Jul 23, 2023
b8fdc2f
Update docker-publish.yml
curtishall Jul 23, 2023
37412d0
Update docker-publish.yml
curtishall Jul 23, 2023
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
273 changes: 271 additions & 2 deletions server/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,275 @@
# set a base image with environment to build from
FROM ubuntu:20.04 AS baseos

ARG BLUECHERRY_GIT_BRANCH_TAG=v3.0.4
RUN echo $BLUECHERRY_DB_HOST

ARG BLUECHERRY_GIT_BRANCH_TAG=v3.1.0-rc8
ARG MYSQLHOST
ENV MYSQL_HOST=MYSQLHOST

#RUN echo "Testing github network env"
#RUN echo ${{ steps.github-network.outputs.gateway-address }}
RUN echo $MYSQL_HOST

# ---------------------------------------------------------------------------
# Build the base OS with some development libs and tools
FROM baseos AS os_dev_environment
ENV DEBIAN_FRONTEND=noninteractive
WORKDIR /root

CMD ["echo", "Testing mysql connection via nmap..."]

RUN apt-get update
RUN apt-get -y install nmap
RUN nmap 127.0.0.1 -p 3306

CMD ["echo", "Installing other stuff..."]

#RUN apt-get install --no-install-recommends -y \
# git sudo openssl ca-certificates wget gnupg gnupg2 gnupg1 \
# ssl-cert nmap curl sysstat iproute2 \
# autoconf automake libtool build-essential gcc g++ \
# debhelper ccache bison flex texinfo yasm cmake

#RUN apt-get install --no-install-recommends -y \
# libbsd-dev libopencv-dev libudev-dev libva-dev \
# linux-image-generic linux-headers-generic \
# libmysqlclient-dev rsyslog

CMD ["echo", "Testing mysql connection..."]

RUN apt install -y mysql-client
#RUN ip a
#RUN mysql -uroot -proot -hmysql -e 'SELECT version()'


# ---------------------------------------------------------------------------
FROM os_dev_environment as bluecherry_base_environment
ENV DEBIAN_FRONTEND=noninteractive
WORKDIR /root

#RUN git clone --progress --depth 1 \
# http://github.com/bluecherrydvr/bluecherry-apps.git \
# && cd bluecherry-apps \
# && git checkout $BLUECHERRY_GIT_BRANCH_TAG

#RUN apt-get --no-install-recommends -y install \
# libbsd0 libc6 libgcc1 libssl1.1 libstdc++6 libudev1 \
# zlib1g ucf mkvtoolnix v4l-utils vainfo i965-va-driver

CMD ["echo", "**************** NMAP output..."]
RUN apt-get update
RUN apt-get -y install nmap
RUN nmap 127.0.0.1 -p 3306

CMD ["echo", "Installing other stuff..."]

RUN apt install -y --no-install-recommends wget sudo gnupg
#RUN wget -q https://repo.mysql.com/RPM-GPG-KEY-mysql-2022 -O- | apt-key add -
RUN apt update

#RUN apt-get --no-install-recommends -y install \
# php-mail php-mail-mime php-net-smtp php-gd php-curl \
# php-mysql php-sqlite3 \
# mysql-client sqlite3

# ---------------------------------------------------------------------------
# Build the bluecherry app and dependencies. This is done in a separate
# image because there are many ways it can fail and then we save time
# by being able to reuse prior containers leading up to this build.
#FROM bluecherry_base_environment as bluecherry_build
#ENV DEBIAN_FRONTEND=noninteractive
#WORKDIR /root

#COPY depends/onvif_tool bluecherry-apps/utils/onvif_tool

#RUN cd bluecherry-apps \
# && ./scripts/build_pkg_native.sh


# ---------------------------------------------------------------------------
#FROM bluecherry_build as bluecherry_build_cleaned
ENV DEBIAN_FRONTEND=noninteractive
WORKDIR /root

RUN rm -rf /usr/src/linux-headers-*

RUN rm -rf .ccache \
&& rm -rf bluecherry-apps/.git \
&& rm -rf bluecherry-apps/misc/libav \
&& rm -rf bluecherry-apps/misc/libconfig \
&& rm -rf bluecherry-apps/misc/pugixml


# ---------------------------------------------------------------------------
# Install the bluecherry app and dependencies
FROM baseos as bluecherry_install
ENV DEBIAN_FRONTEND=noninteractive
WORKDIR /root

#COPY --from=bluecherry_build_cleaned \
# /root/bluecherry-apps/releases/bluecherry_*.deb \
# /root/bluecherry-apps/releases/
RUN apt update
#RUN apt install --no-install-recommends -y wget mariadb-client libopencv-core libopencv-imgcodecs libopencv-imgproc libva-drm2 libva2 mkvtoolnix php-mail php-mail-mime \#
# php-net-smtp sqlite3 nginx php-fpm php-mysql php-sqlite3 v4l-utils vainfo i965-va-driver php-gd php-curl mariadb-client python3-pip python3-distutils gnupg2
RUN apt install --no-install-recommends -y libbsd0 libc6 libgcc-s1 libmariadb3 libopencv-core4.2 libopencv-imgcodecs4.2 libopencv-imgproc4.2 curl \
libssl1.1 libstdc++6 libudev1 libva-drm2 libva2 zlib1g ssl-cert ucf curl sysstat mkvtoolnix php-mail \
php-mail-mime php-net-smtp sqlite3 nmap nginx php-fpm php-mysql php-sqlite3 v4l-utils vainfo i965-va-driver



#RUN wget https://unstable.bluecherrydvr.com/pool/focal/bluecherry_3.1.0-rc8_amd64.deb
RUN curl -k -o /tmp/bluecherry_3.1.0-rc8_amd64.deb https://unstable.bluecherrydvr.com/pool/focal/bluecherry_3.1.0-rc8_amd64.deb

#COPY depends/bluecherry_3.1.0-rc8_amd64.deb /tmp/bluecherry_3.1.0-rc8_amd64.deb

# This step is needed if/when building a new bluecherry docker container
# that will connect to an existing bluecherry database. In this case, the
# bluecherry installer will see the existing database, and it needs the
# /etc/bluecherry.conf file to tell it that it is okay to connect to (and
# modify) that database
#
#COPY bluecherry.conf /etc/bluecherry.conf

ARG MYSQL_ADMIN_LOGIN=root
ARG MYSQL_ADMIN_PASSWORD=root

# Specific database credentials used by bluecherry server
ARG BLUECHERRY_DB_USER=bluecherry
ARG BLUECHERRY_DB_HOST=127.0.0.1
ARG BLUECHERRY_DB_PASSWORD=qiNdklOierSZs2
ARG BLUECHERRY_DB_NAME=bluecherry
ARG BLUECHERRY_DB_ACCESS_HOST=%

# User and Group info used for running bluecherry server processes
ARG BLUECHERRY_LINUX_GROUP_NAME=bluecherry
ARG BLUECHERRY_LINUX_GROUP_ID=1000
ARG BLUECHERRY_LINUX_USER_NAME=bluecherry
ARG BLUECHERRY_LINUX_USER_ID=1000

RUN apt-get update \
&& apt-get install -y \
wget sudo rsyslog nmap curl sysstat iproute2 \
openssl ca-certificates ssl-cert gnupg gnupg2 gnupg1

#COPY my.cnf /root/.my.cnf

#RUN { \
# echo "[client]"; \
# echo "user=$MYSQL_ADMIN_LOGIN"; \
# echo "password=$MYSQL_ADMIN_PASSWORD"; \
# echo "[mysql]"; \
# echo "user=$MYSQL_ADMIN_LOGIN"; \
# echo "password=$MYSQL_ADMIN_PASSWORD"; \
# echo "[mysqldump]"; \
# echo "user=$MYSQL_ADMIN_LOGIN"; \
# echo "password=$MYSQL_ADMIN_PASSWORD"; \
# echo "[mysqldiff]"; \
# echo "user=$MYSQL_ADMIN_LOGIN"; \
# echo "password=$MYSQL_ADMIN_PASSWORD"; \
# } > /root/.my.cnf

# NOTE: The line "export host=$BLUECHERRY_DB_HOST" ... This is required
# due to a weird global check of this env var by the "check_mysql_admin"
# function in /usr/share/bluecherry/bc_db_tool.sh ... which doesn't accept
# the db host as an argument like most of the other functions in that file.
# --- The Specific problem line is:
# if ! echo "show databases" | mysql_wrapper -h"${host}" -u"$MYSQL_ADMIN_LOGIN" &>/dev/null
#
#RUN { \
# echo bluecherry bluecherry/mysql_admin_login string $MYSQL_ADMIN_LOGIN; \
# echo bluecherry bluecherry/mysql_admin_password password $MYSQL_ADMIN_PASSWORD; \
# echo bluecherry bluecherry/db_host string $BLUECHERRY_DB_HOST; \
## echo bluecherry bluecherry/db_host string mysql \
# echo bluecherry bluecherry/db_userhost string $BLUECHERRY_DB_ACCESS_HOST; \
# echo bluecherry bluecherry/db_name string $BLUECHERRY_DB_NAME; \
# echo bluecherry bluecherry/db_user string $BLUECHERRY_DB_USER; \
# echo bluecherry bluecherry/db_password password $BLUECHERRY_DB_PASSWORD; \
# } | debconf-set-selections \
# && export host=mysql \
# && export host=$BLUECHERRY_DB_HOST \
# && dpkg -i /tmp/bluecherry_3.1.0-rc8_amd64.deb

RUN apt install -y php-curl php-gd

RUN { \
echo bluecherry bluecherry/mysql_admin_login string $MYSQL_ADMIN_LOGIN; \
echo bluecherry bluecherry/mysql_admin_password password $MYSQL_ADMIN_PASSWORD; \
echo bluecherry bluecherry/db_host string $BLUECHERRY_DB_HOST; \
echo bluecherry bluecherry/db_userhost string $BLUECHERRY_DB_ACCESS_HOST; \
echo bluecherry bluecherry/db_name string $BLUECHERRY_DB_NAME; \
echo bluecherry bluecherry/db_user string $BLUECHERRY_DB_USER; \
echo bluecherry bluecherry/db_password password $BLUECHERRY_DB_PASSWORD; \
} | debconf-set-selections \
# && export DB_HOST="mysql" \
# && export HOST=mysql \
&& dpkg -i /tmp/bluecherry_3.1.0-rc8_amd64.deb



# Cleanup tasks
RUN apt-get clean \
# && rm -f bluecherry-apps/releases/bluecherry_*.deb \
&& rm -rf /var/lib/apt/lists/*

# Remove these files -- we needed them to build the docker image, since the
# bluecherry installer scripts interact with the database. However, once the
# image is created, we expect it to receive all of the settings/credentials
# from environment variables passed in by docker or docker-compose.
#RUN rm -f /root/.my.cnf \
RUN rm -f /etc/bluecherry.conf

# When running rsyslog in a container, we need to disable imklog
# since the in-container process won't be allowed access to it.
RUN sed -i '/imklog/s/^/#/' /etc/rsyslog.conf

RUN /usr/sbin/groupadd -rf \
--gid=$BLUECHERRY_LINUX_GROUP_ID \
$BLUECHERRY_LINUX_GROUP_NAME \
&& /usr/sbin/useradd -rm \
--comment "Bluecherry DVR" \
--home-dir=/var/lib/bluecherry \
--gid=$BLUECHERRY_LINUX_GROUP_NAME \
--groups=audio,video \
--uid=$BLUECHERRY_LINUX_USER_ID \
$BLUECHERRY_LINUX_USER_NAME \
|| echo "bluecherry user already exists"

RUN mkdir /recordings \
&& chown bluecherry:bluecherry /recordings

EXPOSE 7001/tcp 7002/tcp

# This is the main script that runs as process ID 1 in the docker container
COPY entrypoint.sh /entrypoint.sh

# These scripts are wrappers used to manage the bluecherry database. They are
# necessary because the bluecherry installer usually sets up the database, but
# with a pre-built docker image the installer isn't run (so these actions have
# to be done manually as needed from the docker container... example usage
# from the docker host looks like:
#
# --- CREATE: sudo docker-compose run bluecherry bc-database-create
# --- UPGRADE: sudo docker-compose run bluecherry bc-database-upgrade
COPY bc-database-create.sh /bin/bc-database-create
COPY bc-database-upgrade.sh /bin/bc-database-upgrade

# This copies in a modified rsyslog config, which tells rsyslog to route
# bluecherry logs to both /var/log/bluecherry.log (within the container) and
# also to the STDOUT of container process with PID 1, which then allows the
# logs to be received by the docker engine (and read via `docker logs` , etc.)
COPY bc-rsyslog.conf /etc/rsyslog.d/10-bluecherry.conf

# Make the previously copied scripts executable
RUN chmod +x /entrypoint.sh \
&& chmod +x /bin/bc-database-create \
&& chmod +x /bin/bc-database-upgrade

CMD "/entrypoint.sh"


#ARG BLUECHERRY_GIT_BRANCH_TAG=v3.0.4


# ---------------------------------------------------------------------------
Expand Down Expand Up @@ -41,7 +309,8 @@ RUN apt-get --no-install-recommends -y install \
RUN apt-get --no-install-recommends -y install \
php-mail php-mail-mime php-net-smtp php-gd php-curl \
php-mysql php-sqlite3 \
apache2 libapache2-mod-php mysql-client sqlite3
# apache2 libapache2-mod-php mysql-client sqlite3
nginx default-mysql-client sqlite3

# ---------------------------------------------------------------------------
# Build the bluecherry app and dependencies. This is done in a separate
Expand Down
54 changes: 54 additions & 0 deletions server/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
version: '3.9'
services:
mysql:
image: mysql:5.7
container_name: mysql
#command: --default-authentication-plugin=mysql_native_password
# options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
restart: always
volumes:
- ./database:/var/lib/mysql
# - "/etc/timezone:/etc/timezone:ro"
# - "/etc/localtime:/etc/localtime:ro"
ports:
- 3306:3306
healthcheck:
test: ["CMD", "mysqladmin" ,"ping", "-h", "localhost"]
interval: 30s
timeout: 10s
retries: 5
#options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
environment:
MYSQL_DATABASE: testdb
MYSQL_ROOT_PASSWORD: root
#testing
MYSQL_USER: emc
MYSQL_PASSWORD: emc
TZ: America/Chicago
#healthcheck:
# test: ["CMD", "mysqladmin" ,"ping", "-h", "localhost"]
# timeout: 20s
# retries: 10
# networks:
# - bluecherry

bc-server:
build: .
depends_on:
mysql:
condition: service_completed_successfully
# networks:
# - bluecherry
# args:
# MYSQL_ADMIN_PASSWORD: $MYSQL_ADMIN_PASSWORD
# MYSQL_ADMIN_LOGIN: $MYSQL_ADMIN_LOGIN
# BLUECHERRY_DB_USER: $BLUECHERRY_DB_USER
# BLUECHERRY_DB_PASSWORD: $BLUECHERRY_DB_PASSWORD
# BLUECHERRY_DB_NAME: $BLUECHERRY_DB_NAME
# BLUECHERRY_DB_HOST: $BLUECHERRY_DB_HOST
# BLUECHERRY_DB_ACCESS_HOST: $BLUECHERRY_DB_ACCESS_HOST
# BLUECHERRY_LINUX_GROUP_ID: $BLUECHERRY_LINUX_GROUP_ID
# BLUECHERRY_LINUX_USER_ID: $BLUECHERRY_LINUX_USER_ID
#networks:
# bluecherry:
# name: bluecherry