diff --git a/README.md b/README.md index af557a0d..e8186912 100644 --- a/README.md +++ b/README.md @@ -13,21 +13,26 @@ The easiest way to have a working server is to build a Docker container. ### Docker First, build the container with the following command: + ``` docker build -t fic . ``` Then, run it with: + ``` docker run -t -i -P fic ``` + 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. When you see: + ``` root@xxxxxxxxxxxx:/var/www/fic-server/misc# ``` + congratulations, the container is running! Use `docker ps` to view to which local ports was assigned the contained @@ -90,6 +95,53 @@ CONNTRACK states. #### 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 * `realpath`;