-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
75 lines (61 loc) · 2.29 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
# Our dependencies ore too old for Composer 2
FROM composer:1 AS composer
FROM phusion/baseimage:18.04-1.0.0
SHELL ["/bin/bash", "-o", "pipefail", "-c", "-x"]
RUN export DEBIAN_FRONTEND=noninteractive && \
apt-get update && \
# Need git for composer, sqlite to import sql, cron for background
# tasks and ssmtp to avoid having cron pull in a full blown MTA
# like Exim, and apache, php and extensions
apt-get -q install -y --no-install-recommends \
apache2 \
git \
php \
php-curl \
php-intl \
php-sqlite3 \
php-xml \
sqlite3 \
ssmtp \
unzip \
&& \
# And clean up
apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
COPY ./ /harvester
# Composer for building Harvester.
COPY --from=composer /usr/bin/composer /usr/bin/composer
# REST service app requires mod_rewrite.
RUN a2enmod rewrite && \
# Link in
rm -rf /var/www/html && \
ln -s /harvester/web /var/www/html && \
# Run composer to install app.
export HOME=/root && \
cd /harvester && \
composer install --optimize-autoloader --classmap-authoritative && \
# Fix up permissions for webapp.
chmod a+w -R /harvester/app/cache /harvester/app/logs
# Setup defaults for variables.
ENV HARVESTER_SECRET ThisTokenIsNotSoSecretChangeIt
ENV HARVESTER_HOURS_PER_DAY 7.5
ENV HARVESTER_BILLABILITY_GOAL 75
ENV HARVESTER_HARVEST_USER harvest_account_email@email.com
ENV HARVESTER_HARVEST_PASSWORD secretpassword
ENV HARVESTER_HARVEST_ACCOUNT harvestapp_account_name
ENV SYMFONY_ENV prod
# Fix AllowOverride All for /var/www/html
COPY docker/apache2.conf /etc/apache2/apache2.conf
# Override with custom PHP settings
COPY docker/opcache-config.ini /etc/php/7.2/mods-available/
COPY docker/php-config.ini /etc/php/7.2/mods-available/
RUN phpenmod opcache-config php-config
# Add our crontab.
COPY docker/crontab /etc/cron.d/harvester
RUN chmod go= /etc/cron.d/harvester
# Script for setting up harvester.
COPY docker/harvester /etc/my_init.d/
# Make runit start apache.
COPY docker/apache2.service /etc/service/apache2/run
# And error forwarding.
COPY docker/apache-error-forwarder.service /etc/service/apache-error-forwarder/run
WORKDIR /harvester