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

docker build #2992

Draft
wants to merge 1 commit into
base: alpha
Choose a base branch
from
Draft
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
3 changes: 3 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.git
/vendor
/docs
14 changes: 10 additions & 4 deletions .github/workflows/docker-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,20 +30,26 @@ jobs:
run: |
docker build -t jeedom:bullseye --build-arg DEBIAN=bullseye --build-arg DATABASE=1 .
- name: run jeedom:bullseye and check
# build current image for bullseye and check it
# run current image for bullseye and check it
run: |
docker run -p 80:80 -d --rm --name jeedom_bullseye jeedom:bullseye
sleep 45
until [ "`docker inspect -f {{.State.Health.Status}} jeedom_bullseye`" == "healthy" ]; do
echo "waiting container to be healthy..."
sleep 5;
done;
docker exec jeedom_bullseye php sick.php
- name: Build jeedom:bookworm
# build current image for bookworm
run: |
docker build -t jeedom:bookworm --build-arg DEBIAN=bookworm --build-arg DATABASE=1 .
- name: run jeedom:bookworm and check
# build current image for bookworm and check it
# run current image for bookworm and check it
run: |
docker run -p 81:80 -d --rm --name jeedom_bookworm jeedom:bookworm
sleep 45
until [ "`docker inspect -f {{.State.Health.Status}} jeedom_bookworm`" == "healthy" ]; do
echo "waiting container to be healthy..."
sleep 5;
done;
docker exec jeedom_bookworm php sick.php

- name: Clean docker image
Expand Down
49 changes: 36 additions & 13 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -35,30 +35,53 @@ VOLUME /var/lib/mysql

#speed up build using docker cache
RUN apt update -y
RUN apt -o Dpkg::Options::="--force-confdef" -y install software-properties-common \
RUN apt -o Dpkg::Options::="--force-confdef" -y -q install software-properties-common \
ntp ca-certificates unzip curl sudo cron locate tar telnet wget logrotate dos2unix ntpdate htop \
iotop vim iftop smbclient git python3 python3-pip libexpat1 ssl-cert \
apt-transport-https xvfb cutycapt xauth at mariadb-client espeak net-tools nmap ffmpeg usbutils \
gettext libcurl3-gnutls chromium librsync-dev ssl-cert iputils-ping \
apache2 apache2-utils libexpat1 ssl-cert \
php libapache2-mod-php php-json php-mysql php-curl php-gd php-imap php-xml php-opcache php-soap php-xmlrpc \
php-common php-dev php-zip php-ssh2 php-mbstring php-ldap php-yaml php-snmp && apt -y remove brltty
php-common php-dev php-zip php-ssh2 php-mbstring php-ldap php-yaml php-snmp \
npm && \
# install npm, and node with fixed version
npm install n -g && n 20.18.1 && \
#clean
apt -y remove brltty

COPY install/install.sh /tmp/
RUN sh /tmp/install.sh -s 1 -v ${VERSION} -w ${WEBSERVER_HOME} -d ${DATABASE} -i docker
RUN sh /tmp/install.sh -s 2 -v ${VERSION} -w ${WEBSERVER_HOME} -d ${DATABASE} -i docker
RUN sh /tmp/install.sh -s 3 -v ${VERSION} -w ${WEBSERVER_HOME} -d ${DATABASE} -i docker
RUN sh /tmp/install.sh -s 4 -v ${VERSION} -w ${WEBSERVER_HOME} -d ${DATABASE} -i docker
RUN sh /tmp/install.sh -s 5 -v ${VERSION} -w ${WEBSERVER_HOME} -d ${DATABASE} -i docker
COPY --chown=root:root --chmod=550 install/install.sh /root/
# install step by step : step_1_upgrade ... useless, using the LATEST debian
# RUN sh /root/install.sh -s 1 -v ${VERSION} -w ${WEBSERVER_HOME} -d ${DATABASE} -i docker
# step_2_mainpackage ... useless, already installed before
# RUN sh /root/install.sh -s 2 -v ${VERSION} -w ${WEBSERVER_HOME} -d ${DATABASE} -i docker
# step_3_database ... only if $DATABASE
RUN sh /root/install.sh -s 3 -v ${VERSION} -w ${WEBSERVER_HOME} -d ${DATABASE} -i docker
# step_4_apache
RUN sh /root/install.sh -s 4 -v ${VERSION} -w ${WEBSERVER_HOME} -d ${DATABASE} -i docker
# step_5_php : install php with extensions
RUN sh /root/install.sh -s 5 -v ${VERSION} -w ${WEBSERVER_HOME} -d ${DATABASE} -i docker
# step 6 : copy jeedom source files from local
COPY . ${WEBSERVER_HOME}
RUN sh /tmp/install.sh -s 7 -v ${VERSION} -w ${WEBSERVER_HOME} -d ${DATABASE} -i docker
RUN sh /tmp/install.sh -s 8 -v ${VERSION} -w ${WEBSERVER_HOME} -d ${DATABASE} -i docker
RUN sh /tmp/install.sh -s 9 -v ${VERSION} -w ${WEBSERVER_HOME} -d ${DATABASE} -i docker
RUN sh /tmp/install.sh -s 10 -v ${VERSION} -w ${WEBSERVER_HOME} -d ${DATABASE} -i docker
RUN sh /tmp/install.sh -s 11 -v ${VERSION} -w ${WEBSERVER_HOME} -d ${DATABASE} -i docker
# step_7_jeedom_customization_mariadb
RUN sh /root/install.sh -s 7 -v ${VERSION} -w ${WEBSERVER_HOME} -d ${DATABASE} -i docker
# step_8_jeedom_customization
RUN sh /root/install.sh -s 8 -v ${VERSION} -w ${WEBSERVER_HOME} -d ${DATABASE} -i docker
# step_9_jeedom_configuration
RUN sh /root/install.sh -s 9 -v ${VERSION} -w ${WEBSERVER_HOME} -d ${DATABASE} -i docker
# step_10_jeedom_installation : install composer
COPY --from=composer/composer:latest-bin /composer /usr/bin/composer
RUN composer install --no-ansi --no-dev --no-interaction --no-plugins --no-progress --no-scripts --optimize-autoloader
# RUN sh /root/install.sh -s 10 -v ${VERSION} -w ${WEBSERVER_HOME} -d ${DATABASE} -i docker
# step_11_jeedom_post
RUN sh /root/install.sh -s 11 -v ${VERSION} -w ${WEBSERVER_HOME} -d ${DATABASE} -i docker

RUN apt-get clean && rm -rf /var/lib/apt/lists/*
RUN echo >${WEBSERVER_HOME}/initialisation

# check if apache is running
HEALTHCHECK --interval=1m --timeout=3s --retries=5 --start-period=10s --start-interval=5s \
CMD curl -f http://localhost/ || exit 1

WORKDIR ${WEBSERVER_HOME}
EXPOSE 80
EXPOSE 443
Expand Down
Loading
Loading