created Dockerfile

This commit is contained in:
Norman 2020-12-16 16:14:54 -08:00
parent 1f4cf634f2
commit fc5248d827
15 ha cambiato i file con 28 aggiunte e 6 eliminazioni

BIN
.DS_Store esterno Normal file

File binario non mostrato.

12
.docker/Dockerfile Normal file
Vedi 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

2
.gitignore esterno
Vedi File

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

Vedi 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`

Vedi 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

Vedi File

Prima

Larghezza:  |  Altezza:  |  Dimensione: 13 KiB

Dopo

Larghezza:  |  Altezza:  |  Dimensione: 13 KiB

Vedi File

@ -1,4 +1,4 @@
<?php
<?php
session_start();
require_once 'php/config.inc.php';

Vedi 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