Skip to content

Commit

Permalink
Prepare and push the docker image for 1.4.3
Browse files Browse the repository at this point in the history
  • Loading branch information
alextselegidis committed Aug 14, 2023
1 parent bb35a76 commit 8c797c1
Show file tree
Hide file tree
Showing 5 changed files with 122 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.idea
test
42 changes: 42 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
FROM php:8.0-apache

MAINTAINER Alex Tselegidis (alextselegidis.com)

ENV VERSION="1.4.3"
ENV BASE_URL="http://localhost"
ENV LANGUAGE="english"
ENV DEBUG_MODE="FALSE"
ENV DB_HOST="db"
ENV DB_NAME="easyappointments"
ENV DB_USERNAME="root"
ENV DB_PASSWORD="secret"
ENV GOOGLE_SYNC_FEATURE=FALSE
ENV GOOGLE_PRODUCT_NAME=""
ENV GOOGLE_CLIENT_ID=""
ENV GOOGLE_CLIENT_SECRET=""
ENV GOOGLE_API_KEY=""

EXPOSE 80

WORKDIR /var/www/html

COPY ./assets/99-overrides.ini /usr/local/etc/php/conf.d

COPY ./assets/docker-entrypoint.sh /usr/local/bin

RUN apt-get update \
&& apt-get install -y libfreetype-dev libjpeg62-turbo-dev libpng-dev unzip wget nano \
&& curl -sSL https://github.com/mlocati/docker-php-extension-installer/releases/latest/download/install-php-extensions -o - | sh -s \
curl gd mbstring mysqli xdebug gettext \
&& docker-php-ext-enable xdebug \
&& wget https://github.com/alextselegidis/easyappointments/releases/download/${VERSION}/easyappointments-${VERSION}.zip \
&& unzip easyappointments-${VERSION}.zip \
&& rm easyappointments-${VERSION}.zip \
&& echo "alias ll=\"ls -al\"" >> /root/.bashrc \
&& apt-get -y autoremove \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* \
&& chown -R www-data:www-data .

ENTRYPOINT ["docker-entrypoint.sh"]

5 changes: 5 additions & 0 deletions assets/99-overrides.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
upload_max_filesize = 100M
post_max_size = 100M
xdebug.mode = debug
xdebug.client_host = host.docker.internal
xdebug.log_level = 0
41 changes: 41 additions & 0 deletions assets/docker-entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
#!/bin/bash

# -----------------------------------------------------------------------------
# Easy!Appointments - Online Appointment Scheduler
#
# @package EasyAppointments
# @author A.Tselegidis <alextselegidis@gmail.com>
# @copyright Copyright (c) Alex Tselegidis
# @license https://opensource.org/licenses/GPL-3.0 - GPLv3
# @link https://easyappointments.org
# -----------------------------------------------------------------------------

##
# Set up the currently cloned Easy!Appointments build.
#
# This script will perform the required actions so that Easy!Appointments is configured properly to work with the
# provided environment variables.
#
# Usage:
#
# ./docker-entrypoint.sh
#

cp config-sample.php config.php

sed -i "s|const BASE_URL = 'http://url-to-easyappointments-directory';|const BASE_URL = '$BASE_URL';|g" config.php
sed -i "s|const LANGUAGE = 'english';|const LANGUAGE = '$LANGUAGE';|g" config.php
sed -i "s|const DEBUG_MODE = FALSE;|const DEBUG_MODE = $DEBUG_MODE;|g" config.php

sed -i "s|const DB_HOST = 'localhost';|const DB_HOST = '$DB_HOST';|g" config.php
sed -i "s|const DB_NAME = 'easyappointments';|const DB_NAME = '$DB_NAME';|g" config.php
sed -i "s|const DB_USERNAME = 'root';|const DB_USERNAME = '$DB_USERNAME';|g" config.php
sed -i "s|const DB_PASSWORD = 'root';|const DB_PASSWORD = '$DB_PASSWORD';|g" config.php

sed -i "s|const GOOGLE_SYNC_FEATURE = FALSE;|const GOOGLE_SYNC_FEATURE = '$GOOGLE_SYNC_FEATURE';|g" config.php
sed -i "s|const GOOGLE_PRODUCT_NAME = '';|const GOOGLE_PRODUCT_NAME = '$GOOGLE_GOOGLE_PRODUCT_NAME';|g" config.php
sed -i "s|const GOOGLE_CLIENT_ID = '';|const GOOGLE_CLIENT_ID = '$GOOGLE_CLIENT_ID';|g" config.php
sed -i "s|const GOOGLE_CLIENT_SECRET = '';|const GOOGLE_CLIENT_SECRET = '$GOOGLE_CLIENT_SECRET';|g" config.php
sed -i "s|const GOOGLE_API_KEY = '';|const GOOGLE_API_KEY = '$GOOGLE_API_KEY';|g" config.php

apache2-foreground
32 changes: 32 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#!/bin/bash

# -----------------------------------------------------------------------------
# Easy!Appointments - Online Appointment Scheduler
#
# @package EasyAppointments
# @author A.Tselegidis <alextselegidis@gmail.com>
# @copyright Copyright (c) Alex Tselegidis
# @license https://opensource.org/licenses/GPL-3.0 - GPLv3
# @link https://easyappointments.org
# -----------------------------------------------------------------------------

##
# Build a docker image for an Easy!Appointments release.
#
# This script will create a new local Docker image for a tagged Easy!Appointments release, that has a zip package file
# attached to it on Github (see https://github.com/alextselegidis/easyappointments/releases).
#
# Usage:
#
# ./build.sh <version>
#
# Example:
#
# ./build.sh 1.4.3
#

DEFAULT_VERSION=1.4.3

VERSION="${1:-$DEFAULT_VERSION}"

docker build --tag easyappointments:${VERSION} --build-arg VERSION=${VERSION} .

0 comments on commit 8c797c1

Please sign in to comment.