Browse Source

created Dockerfile

dockerize
Norman 2 months ago
parent
commit
fc5248d827
15 changed files with 28 additions and 6 deletions
  1. BIN
      .DS_Store
  2. +12
    -0
      .docker/Dockerfile
  3. +1
    -1
      .gitignore
  4. +12
    -2
      README.md
  5. +1
    -1
      config/env.example.php
  6. +0
    -0
      lockbox/admin.php
  7. +0
    -0
      lockbox/css/custom.css
  8. +0
    -0
      lockbox/css/normalize.css
  9. +0
    -0
      lockbox/css/skeleton.css
  10. +0
    -0
      lockbox/img/logo.png
  11. +1
    -1
      lockbox/index.php
  12. +1
    -1
      lockbox/php/config.inc.php
  13. +0
    -0
      lockbox/php/footer.tpl.php
  14. +0
    -0
      lockbox/php/form.inc.php
  15. +0
    -0
      lockbox/php/header.tpl.php

BIN
.DS_Store View File


+ 12
- 0
.docker/Dockerfile View File

@@ -0,0 +1,12 @@
FROM php:7.4-apache

# Set working directy at web server root
WORKDIR /var/www/html

# Manually installs Lockbox
COPY ../lockbox/* /
COPY ../config/env.example.php ./php/env.php
COPY ../config/key.public .

RUN mkdir /var/www/data
RUN chmod 666 /var/www/data

+ 1
- 1
.gitignore View File

@@ -1 +1 @@
php/env.php
lockbox/php/env.php

+ 12
- 2
README.md View File

@@ -1,3 +1,13 @@
![](./img/logo.png)
![](lockbox/img/logo.png)

This is the PHP/webserver component for Lockbox. For instructions visit [the Lockbox app's main repository](https://git.openprivacy.ca/openprivacy/lockbox).
This is the PHP/webserver component for Lockbox. For instructions visit [the Lockbox app`s main repository](https://git.openprivacy.ca/openprivacy/lockbox).


## Docker Install Instructions
Right now, there is a very basic process to building and deploying a Docker image of Lockbox in a container that contains php and an instance of apache webserver. The image has been tested on linux base OS and will need to be run of a host that already has the OS installed. Future development will aim to have a more robust install.

Note: This version of the Docker deployment is using an `env.php` file instead of environment variables due to some of the nuances with how php handles environment variables.

The `.docker` directory contains a Dockerfile to build an image for your deployment. Do the following before building the image:
* Modify `config/env.example.php` based on any customizations
* Generate a keypair (you can use the script in the `cmd` folder (`genkeys.php.txt`, which needs to be renamed to `genkeys.php` prior to use, or use a key pair you have already generated) and place the public key in the `config` folder as `key.public`

php/env.example.php → config/env.example.php View File

@@ -3,7 +3,7 @@
$conf_vars = [
'LB_DL_PASS' => '',
'LB_FILE' => '/var/www/data/lockbox.dat', // This is the submissions file -- it should not be in your web directory!!!
'LB_PUBKEY_FILE' => 'lockbox-web/key.public' // Public key file location relative to the website root (i.e., $_SERVER['DOCUMENT_ROOT'])
'LB_PUBKEY_FILE' => '/var/www/html/key.public' // Absolute parth of public key file
];

// restrict the (optional) admin form to these IPs

admin.php → lockbox/admin.php View File


css/custom.css → lockbox/css/custom.css View File


css/normalize.css → lockbox/css/normalize.css View File


css/skeleton.css → lockbox/css/skeleton.css View File


img/logo.png → lockbox/img/logo.png View File


index.php → lockbox/index.php View File

@@ -1,4 +1,4 @@
<?php
<?php

session_start();
require_once 'php/config.inc.php';

php/config.inc.php → lockbox/php/config.inc.php View File

@@ -33,7 +33,7 @@ $ADMIN_IPS = $ips;
define('DL_PASS', $conf_vars['LB_DL_PASS']);

// This is the path to the public key file
define(PK_FILE, $_SERVER['DOCUMENT_ROOT']."/".$conf_vars['LB_PUBKEY_FILE']);
define('PK_FILE', $conf_vars['LB_PUBKEY_FILE']);

// ============ include file locations -- you shouldn't need to change below this line


php/footer.tpl.php → lockbox/php/footer.tpl.php View File


php/form.inc.php → lockbox/php/form.inc.php View File


php/header.tpl.php → lockbox/php/header.tpl.php View File


Loading…
Cancel
Save