Fill README with some steps for production env

This commit is contained in:
nemunaire 2015-01-13 17:55:24 +01:00 committed by Nemunaire
parent d687920779
commit a67912e89e

View File

@ -13,21 +13,26 @@ The easiest way to have a working server is to build a Docker container.
### Docker ### Docker
First, build the container with the following command: First, build the container with the following command:
``` ```
docker build -t fic . docker build -t fic .
``` ```
Then, run it with: Then, run it with:
``` ```
docker run -t -i -P fic docker run -t -i -P fic
``` ```
It will ask you for a passphrase, you must provide one with at least 4 It will ask you for a passphrase, you must provide one with at least 4
characters. This key is used to generate the server certificate. characters. This key is used to generate the server certificate.
When you see: When you see:
``` ```
root@xxxxxxxxxxxx:/var/www/fic-server/misc# root@xxxxxxxxxxxx:/var/www/fic-server/misc#
``` ```
congratulations, the container is running! congratulations, the container is running!
Use `docker ps` to view to which local ports was assigned the contained Use `docker ps` to view to which local ports was assigned the contained
@ -90,6 +95,53 @@ CONNTRACK states.
#### Backend #### Backend
##### Docker containers
Main Docker backend container relies on several other container:
* MySQL database ;
* Database storage (as data only container) ;
* PKI storage ;
* PKI shared storage ;
* challenge files containers ;
* the backend.
To have a fully working backend:
1. Create a data-only container:
```
docker run --name mysql_data -v /var/lib/mysql busybox
```
2. Setup the MySQL server:
```
docker run -d --name db_setup --volumes-from mysql_data -e MYSQL_ROOT_PASSWORD=mysecretpassword -e MYSQL_USER=fic -e MYSQL_PASSWORD=anotherpassword -e MYSQL_DATABASE=fic mysql
```
Fill the database:
```
docker build -t db_filler db/
docker run --rm -it --link db_setup:db db_filler
```
Stop it:
```
docker stop db_setup
docker rm db_setup
```
3. Run the database container:
```
docker run -d --name db --volumes-from mysql_data mysql
```
##### Requirements ##### Requirements
* `realpath`; * `realpath`;