Skip to content
Permalink
Browse files

Add missing docker bits

  • Loading branch information...
kiwiz committed Apr 3, 2019
1 parent c10b540 commit 9fc3a830447ecde87f68d15424dc0cdc763ff035
Showing with 78 additions and 4 deletions.
  1. +5 −4 Dockerfile
  2. +10 −0 bin/generate_images.sh
  3. +18 −0 data/411.conf
  4. +2 −0 data/411_cron
  5. +34 −0 data/init.php
  6. +1 −0 data/mail.ini
  7. +8 −0 data/supervisord.conf
@@ -31,10 +31,11 @@ RUN sed -i 's/HOSTNAME/fouroneone/g' /data/411.conf
RUN sed -i 's/# SetEnv FOURONEONEHOST/SetEnv FOURONEONEHOST/g' /data/411.conf
RUN sed -i 's$/var/www/411$/app$g' /data/411.conf

RUN cp /app/docker/supervisord.conf /data/supervisord.conf
RUN cp /app/docker/mail.ini /data/mail.ini
RUN cp /app/docker/411_cron /data/411_cron
RUN /app/docker/init.php
RUN ls /app
RUN cp /app/data/supervisord.conf /data/supervisord.conf
RUN cp /app/data/mail.ini /data/mail.ini
RUN cp /app/data/411_cron /data/411_cron
RUN /app/data/init.php

RUN rm -rf /app/docker

@@ -0,0 +1,10 @@
#!/bin/bash

docker build -t kaiz/411:latest . --build-arg COMPOSER=composer-es2x.json
docker build -t kaiz/411:es2x . --build-arg COMPOSER=composer-es2x.json
docker build -t kaiz/411:es5x . --build-arg COMPOSER=composer-es5x.json
docker build -t kaiz/411:es6x . --build-arg COMPOSER=composer-es6x.json
docker push kaiz/411:latest
docker push kaiz/411:es2x
docker push kaiz/411:es5x
docker push kaiz/411:es6x
@@ -0,0 +1,18 @@
<VirtualHost *:80>
ServerName fouroneone

php_value include_path ".:/app/phplib"

DirectoryIndex index.php index.html index.htm
DocumentRoot /app/htdocs

# Force this vhost to use a specific 411 instance.
SetEnv FOURONEONEHOST fouroneone

<Directory /app/htdocs>
AllowOverride Indexes FileInfo Options
Options -Indexes +FollowSymLinks
Require all granted
</Directory>

</VirtualHost>
@@ -0,0 +1,2 @@
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
* * * * * root /usr/local/bin/php /var/www/411/bin/cron.php > /dev/null 2>&1 && /usr/local/bin/php /var/www/411/bin/worker.php > /dev/null 2>&1
@@ -0,0 +1,34 @@
#!/usr/bin/env php
<?php
require_once('/app/phplib/411bootstrap.php');
$newsite = new FOO\Site();
$newsite['name'] = 'FourOneOne';
$newsite['host'] = 'fouroneone';
$newsite['secure'] = false;
$newsite->store();
FOO\SiteFinder::setSite($newsite);
$cfg = new FOO\DBConfig();
$cfg['cookie_secret'] = FOO\Random::base64_bytes(FOO\Cookie::SECRET_LEN);
$cfg['timezone'] = 'UTC';
$cfg['cron_enabled'] = 1;
$cfg['worker_enabled'] = 1;
$cfg['summary_enabled'] = 1;
$cfg['last_cron_date'] = 0;
$cfg['last_rollup_date'] = 0;
$cfg['error_email_enabled'] = 1;
$cfg['error_email_throttle'] = 30;
$cfg['from_email'] = 'alert@fouroneone';
$cfg['from_error_email'] = 'error@fouroneone';
$cfg['default_email'] = 'admin@example.com';
$newuser = new FOO\User();
$newuser['name'] = 'admin';
$newuser['real_name'] = 'Admin';
$newuser->setPassword('admin');
$newuser['email'] = 'admin@example.com';
$newuser['admin'] = true;
$newuser['api_key'] = FOO\Random::base64_bytes(FOO\User::API_KEY_LEN);
$newuser->store();
@@ -0,0 +1 @@
sendmail_path = /usr/sbin/sendmail -t -i
@@ -0,0 +1,8 @@
[supervisord]
nodaemon=true

[program:cron]
command=/usr/sbin/cron -f

[program:apache2]
command=/bin/bash -c "source /etc/apache2/envvars && exec /usr/sbin/apache2 -DFOREGROUND"

0 comments on commit 9fc3a83

Please sign in to comment.
You can’t perform that action at this time.