-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Parallel builds for Apache and nginx variants
- Loading branch information
Showing
6 changed files
with
196 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# Multi-stage build, see https://docs.docker.com/develop/develop-images/multistage-build/ | ||
FROM alpine AS builder | ||
|
||
ENV VERSION 0.9.1 | ||
|
||
ADD https://github.com/sabre-io/Baikal/releases/download/$VERSION/baikal-$VERSION.zip . | ||
RUN apk add unzip && unzip -q baikal-$VERSION.zip | ||
|
||
# Final Docker image | ||
FROM php:8.0-apache | ||
|
||
LABEL description="Baikal is a Cal and CardDAV server, based on sabre/dav, that includes an administrative interface for easy management." | ||
LABEL version="0.9.1" | ||
LABEL repository="https://github.com/ckulka/baikal-docker" | ||
LABEL website="http://sabre.io/baikal/" | ||
|
||
# Install Baikal and required dependencies | ||
COPY --from=builder baikal /var/www/baikal | ||
RUN chown -R www-data:www-data /var/www/baikal &&\ | ||
apt-get update &&\ | ||
apt-get install -y libcurl4-openssl-dev sendmail &&\ | ||
rm -rf /var/lib/apt/lists/* &&\ | ||
docker-php-ext-install curl pdo pdo_mysql | ||
|
||
# Configure Apache + HTTPS | ||
COPY files/apache.conf /etc/apache2/sites-enabled/000-default.conf | ||
RUN a2enmod rewrite ssl && openssl req -x509 -newkey rsa:2048 -subj "/C= " -keyout /etc/ssl/private/baikal.private.pem -out /etc/ssl/private/baikal.public.pem -days 3650 -nodes | ||
|
||
# Expose HTTPS & data directory | ||
EXPOSE 443 | ||
VOLUME /var/www/baikal/config | ||
VOLUME /var/www/baikal/Specific | ||
|
||
COPY files/start.sh /opt | ||
CMD [ "sh", "/opt/start.sh" ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
# Multi-stage build, see https://docs.docker.com/develop/develop-images/multistage-build/ | ||
FROM alpine AS builder | ||
|
||
ENV VERSION 0.9.1 | ||
|
||
ADD https://github.com/sabre-io/Baikal/releases/download/$VERSION/baikal-$VERSION.zip . | ||
RUN apk add unzip && unzip -q baikal-$VERSION.zip | ||
|
||
# Final Docker image | ||
FROM nginx:1 | ||
|
||
LABEL description="Baikal is a Cal and CardDAV server, based on sabre/dav, that includes an administrative interface for easy management." | ||
LABEL version="0.9.1" | ||
LABEL repository="https://github.com/ckulka/baikal-docker" | ||
LABEL website="http://sabre.io/baikal/" | ||
|
||
# Install dependencies: PHP (with libffi6 dependency) & SQLite3 | ||
RUN curl -o /etc/apt/trusted.gpg.d/php.gpg https://packages.sury.org/php/apt.gpg &&\ | ||
apt update &&\ | ||
apt install -y lsb-release &&\ | ||
echo "deb https://packages.sury.org/php/ $(lsb_release -sc) main" > /etc/apt/sources.list.d/php.list &&\ | ||
apt remove -y lsb-release &&\ | ||
apt update &&\ | ||
apt install -y \ | ||
php8.0-curl \ | ||
php8.0-fpm \ | ||
php8.0-mbstring \ | ||
php8.0-mysql \ | ||
php8.0-sqlite3 \ | ||
php8.0-xml \ | ||
sqlite3 \ | ||
sendmail &&\ | ||
rm -rf /var/lib/apt/lists/* &&\ | ||
sed -i 's/www-data/nginx/' /etc/php/8.0/fpm/pool.d/www.conf &&\ | ||
sed -i 's/^listen = .*/listen = \/var\/run\/php-fpm.sock/' /etc/php/8.0/fpm/pool.d/www.conf | ||
|
||
# Add Baikal & nginx configuration | ||
COPY --from=builder baikal /var/www/baikal | ||
RUN chown -R nginx:nginx /var/www/baikal | ||
COPY files/nginx.conf /etc/nginx/conf.d/default.conf | ||
|
||
VOLUME /var/www/baikal/config | ||
VOLUME /var/www/baikal/Specific | ||
CMD /etc/init.d/php8.0-fpm start && chown -R nginx:nginx /var/www/baikal/Specific && nginx -g "daemon off;" |