Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
66 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
FROM php:7.2-apache | ||
|
||
RUN a2dissite 000-default.conf | ||
|
||
# Install php modules | ||
RUN apt-get update \ | ||
&& apt-get install libyaml-dev -y \ | ||
&& pecl install yaml-2.0.2 \ | ||
&& docker-php-ext-enable yaml | ||
|
||
# Install Composer | ||
COPY --from=composer:latest /usr/bin/composer /usr/bin/composer | ||
RUN apt-get install -y --no-install-recommends git zip unzip | ||
|
||
# Data | ||
VOLUME /data | ||
COPY docker / | ||
COPY . /app/pinedocs | ||
# RUN mv /app/pinedocs/docker / | ||
WORKDIR /app/ | ||
|
||
# Install Composer dependencies | ||
RUN composer install -d=/app/pinedocs | ||
|
||
# Override entrypoint | ||
# To make sure data directory exists and symlinks are set when containers are being run. | ||
RUN ["chmod", "+x", "/usr/bin/entrypoint"] | ||
ENTRYPOINT ["/usr/bin/entrypoint"] | ||
CMD ["apache2-foreground"] |
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,14 @@ | ||
<VirtualHost *:80> | ||
DocumentRoot /app/pinedocs/public | ||
|
||
<Directory /app/pinedocs/public> | ||
Options FollowSymLinks | ||
AllowOverride all | ||
Require all granted | ||
</Directory> | ||
|
||
# Possible values include: debug, info, notice, warn, error, crit, alert, emerg. | ||
LogLevel notice | ||
|
||
ServerSignature Off | ||
</VirtualHost> |
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,23 @@ | ||
#!/bin/bash | ||
|
||
# Config | ||
if [ ! -f /data/pinedocs/config/config.yaml ]; then | ||
mkdir -p /data/pinedocs/config | ||
cp /app/pinedocs/config/config-example.yaml /data/pinedocs/config/config.yaml | ||
echo 'Created config file.' | ||
fi | ||
|
||
# Content | ||
if [ ! -f /data/pinedocs/files ]; then | ||
mkdir -p /data/pinedocs/files | ||
cp -a /app/pinedocs/content/. /data/pinedocs/files | ||
echo 'Created content directory.' | ||
fi | ||
|
||
# Setup symlinks | ||
rm -rf /app/pinedocs/config /app/pinedocs/content | ||
ln -sfn /data/pinedocs/config /app/pinedocs/config | ||
ln -sfn /data/pinedocs/files /app/pinedocs/content | ||
|
||
# Run parent entrypoint | ||
exec /usr/local/bin/docker-php-entrypoint "$@" |